How fast you replyed to me! Thought get the answer tommorow, it seemjust several seconds!
got it from following code in org.docx4j.convert.out.pdf.viaIText.Conversion.getRunContent();
- Code: Select all
List<Object> runContent = run.getRunContent();
171
172 for (Object rc : runContent) {
173
174 if (rc instanceof javax.xml.bind.JAXBElement) {
175
176 log.debug("Encountered "
177 + ((JAXBElement) rc).getDeclaredType()
178 .getName());
179
180 if (((JAXBElement) rc).getDeclaredType().getName()
181 .equals("org.docx4j.wml.Text")) {
182
183 org.docx4j.wml.Text t = (org.docx4j.wml.Text) ((JAXBElement) rc)
184 .getValue();
185
186 if (font == null) {
187 pdfParagraph.add(new Chunk(t.getValue()));
188 } else {
189 pdfParagraph.add(new Chunk(t.getValue(), font));
190 }
191 log.debug("Added content " + t.getValue());
192 } else if (((JAXBElement) rc).getDeclaredType()
193 .getName().equals("org.docx4j.wml.Drawing")) {
194
195 org.docx4j.wml.Drawing drawing = (org.docx4j.wml.Drawing) ((JAXBElement) rc)
196 .getValue();
197 addDrawing(drawing, pdfDoc, pdfParagraph);
198
199 } else {
200 log.debug("What? Encountered "
201 + ((JAXBElement) rc).getDeclaredType()
202 .getName());
203 // eg org.docx4j.wml.R$LastRenderedPageBreak
204 }
205
206 } else if (rc instanceof org.docx4j.wml.Br) {
207
208 pdfDoc.newPage();
209
210 } else {
211
212 log.debug("found in R: " + rc.getClass().getName());
213 }
214 }
thanks.
Now it's 22:07 in China. It's time to have a break and go to bed.
Good day, everyone!