@Override protected void addNewLine(CTBr br, IITextContainer pdfParagraphContainer) throws Exception { pdfParagraphContainer.addElement(Chunk.NEWLINE); }
@Override protected void addNewLine( CTBr br, IITextContainer paragraphContainer ) throws Exception { paragraphContainer.addElement( Chunk.NEWLINE ); }
@Override protected void addNewLine(CTBr br, IITextContainer pdfParagraphContainer) throws Exception { pdfParagraphContainer.addElement(Chunk.NEWLINE); }
@Override protected void addNewLine( CTBr br, IITextContainer paragraphContainer ) throws Exception { paragraphContainer.addElement( Chunk.NEWLINE ); }
@Override protected void endVisitTable( XWPFTable table, IITextContainer parentContainer, IITextContainer tableContainer ) throws Exception { parentContainer.addElement( (Element) tableContainer ); }
@Override protected void endVisitParagraph( CTP paragraph, IITextContainer pdfParentContainer, IITextContainer pdfParagraphContainer ) throws Exception { // add the iText paragraph in the current parent container. ExtendedParagraph pdfParagraph = (ExtendedParagraph) pdfParagraphContainer; pdfParentContainer.addElement( pdfParagraph.getElement() ); }
@Override protected void endVisitTable(XWPFTable table, IITextContainer pdfParentContainer, IITextContainer pdfTableContainer) throws Exception { pdfParentContainer.addElement(((ExtendedPdfPTable) pdfTableContainer) .getElement()); }
@Override protected void endVisitTable( CTTbl table, IITextContainer parentContainer, IITextContainer tableContainer ) throws Exception { parentContainer.addElement( ( (ExtendedPdfPTable) tableContainer ).getElement() ); }
@Override protected void endVisitParagraph(XWPFParagraph docxParagraph, IITextContainer pdfParentContainer, IITextContainer pdfParagraphContainer) throws Exception { // add the iText paragraph in the current parent container. ExtendedParagraph pdfParagraph = (ExtendedParagraph) pdfParagraphContainer; pdfParentContainer.addElement(pdfParagraph.getElement()); this.currentRunX = null; }
@Override protected void endVisitParagraph( CTP paragraph, IITextContainer pdfParentContainer, IITextContainer pdfParagraphContainer ) throws Exception { // add the iText paragraph in the current parent container. ExtendedParagraph pdfParagraph = (ExtendedParagraph) pdfParagraphContainer; pdfParentContainer.addElement( pdfParagraph.getElement() ); }
@Override protected void endVisitParagraph(XWPFParagraph docxParagraph, IITextContainer pdfParentContainer, IITextContainer pdfParagraphContainer) throws Exception { // add the iText paragraph in the current parent container. ExtendedParagraph pdfParagraph = (ExtendedParagraph) pdfParagraphContainer; pdfParentContainer.addElement(pdfParagraph.getElement()); this.currentRunX = null; }
@Override protected void endVisitTable(XWPFTable table, IITextContainer pdfParentContainer, IITextContainer pdfTableContainer) throws Exception { pdfParentContainer.addElement(((ExtendedPdfPTable) pdfTableContainer) .getElement()); }
@Override protected void endVisitTable( CTTbl table, IITextContainer parentContainer, IITextContainer tableContainer ) throws Exception { parentContainer.addElement( ( (ExtendedPdfPTable) tableContainer ).getElement() ); }
@Override protected void visitEmptyRun(IITextContainer pdfParagraphContainer) throws Exception { StylableParagraph paragraph = (StylableParagraph) pdfParagraphContainer; IITextContainer parent = paragraph.getParent(); if (parent instanceof StylableTableCell) { StylableTableCell cell = (StylableTableCell) parent; if (cell.getRotation() > 0) { // Run paragraph belongs to Cell which has rotation, ignore the // empty run. return; } } // Add new PDF line pdfParagraphContainer.addElement(Chunk.NEWLINE); }
@Override protected void visitEmptyRun(IITextContainer pdfParagraphContainer) throws Exception { StylableParagraph paragraph = (StylableParagraph) pdfParagraphContainer; IITextContainer parent = paragraph.getParent(); if (parent instanceof StylableTableCell) { StylableTableCell cell = (StylableTableCell) parent; if (cell.getRotation() > 0) { // Run paragraph belongs to Cell which has rotation, ignore the // empty run. return; } } // Add new PDF line pdfParagraphContainer.addElement(Chunk.NEWLINE); }
Chunk chunk = createTextChunk(sbuf.toString(), pageNumber, chunkFont, underlinePatterns, backgroundColor); parent.addElement(chunk); Chunk chunk = createTextChunk(sbuf.toString(), pageNumber, chunkFont, underlinePatterns, backgroundColor); parent.addElement(chunk);
Chunk chunk = createTextChunk(sbuf.toString(), pageNumber, chunkFont, underlinePatterns, backgroundColor); parent.addElement(chunk); Chunk chunk = createTextChunk(sbuf.toString(), pageNumber, chunkFont, underlinePatterns, backgroundColor); parent.addElement(chunk);
@Override protected void visitBookmark(CTBookmark bookmark, XWPFParagraph paragraph, IITextContainer paragraphContainer) throws Exception { // destination for a local anchor // chunk with empty text does not work as local anchor // so we create chunk with invisible but not empty text content // if bookmark is the last chunk in a paragraph something must be added // after or it does not work Chunk chunk = new Chunk(TAB); chunk.setLocalDestination(bookmark.getName()); paragraphContainer.addElement(chunk); }
@Override protected void visitBookmark(CTBookmark bookmark, XWPFParagraph paragraph, IITextContainer paragraphContainer) throws Exception { // destination for a local anchor // chunk with empty text does not work as local anchor // so we create chunk with invisible but not empty text content // if bookmark is the last chunk in a paragraph something must be added // after or it does not work Chunk chunk = new Chunk(TAB); chunk.setLocalDestination(bookmark.getName()); paragraphContainer.addElement(chunk); }
@Override protected void endVisitPargraph( XWPFParagraph paragraph, IITextContainer parentContainer, IITextContainer paragraphContainer ) throws Exception { // Page Break // Cannot use paragraph.isPageBreak() because it throw NPE because // pageBreak.getVal() can be null. CTPPr ppr = paragraph.getCTP().getPPr(); if ( ppr.isSetPageBreakBefore() ) { CTOnOff pageBreak = ppr.getPageBreakBefore(); if ( pageBreak != null && ( pageBreak.getVal() == null || pageBreak.getVal().intValue() == STOnOff.INT_TRUE ) ) { pdfDocument.newPage(); } } // Paragraph ExtendedParagraph pdfParagraph = (ExtendedParagraph) paragraphContainer; parentContainer.addElement( pdfParagraph.getContainer() ); }