Closed GoogleCodeExporter closed 9 years ago
i forgot to add, that the same error happens when using the 'just-generated'
XWPFDocument not like here a loaded file...
Original comment by timopra...@gmail.com
on 27 Nov 2013 at 11:07
Thank's for your attached docx. I will see your problem when I will have time.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 27 Nov 2013 at 1:13
[deleted comment]
when I use xdoc-report (the same method of the first post) happend:
code error:
org.apache.poi.xwpf.converter.core.XWPFConverterException:
java.lang.NullPointerException
at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:59)
at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:37)
at org.apache.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:45)
at pe.edu.rpanaque.docxsunarppdf.ConvertDocx1.main(ConvertDocx1.java:30)
Caused by: java.lang.NullPointerException
at org.apache.poi.xwpf.converter.core.utils.XWPFTableUtil.getGridColList(XWPFTableUtil.java:166)
at org.apache.poi.xwpf.converter.core.utils.XWPFTableUtil.computeColWidths(XWPFTableUtil.java:99)
at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitTable(XWPFDocumentVisitor.java:827)
at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitBodyElements(XWPFDocumentVisitor.java:245)
at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.start(XWPFDocumentVisitor.java:193)
at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:55)
... 3 more
- Also I share you my word document
I have a question:
Why my pdf document has more pages than my word document?
How I can control this behavior?
How I can rewrite the method
"PdfConverter.getInstance().convert(document, out, options);"
to set a standard PDF/A?
....
thanks a lot.
Original comment by rtejadapa
on 28 Dec 2013 at 10:16
Attachments:
I will see your problem when I will have time.
> Why my pdf document has more pages than my word document?
Our converter si not perfect, so you can have this problem (or perhaps it's a
problem of font that you have not on your computer?).
> How I can control this behavior?
You cannot, the page od pdf is managed by iText. Our converter must be
improved, but it's very hard.
> to set a standard PDF/A?
This feature is available for 1.0.4 (you can use the 1.0.4 snapshot with
maven). Please read
https://groups.google.com/forum/#!searchin/xdocreport/IPdfWriterConfiguration/xd
ocreport/xgarPynztF8/gH7s0RasxdoJ
Original comment by angelo.z...@gmail.com
on 28 Dec 2013 at 10:58
[deleted comment]
hi angelo,
i have a problem with the standard PDF/A,
when i export my document to pdf print the
next error:
_______________________
org.apache.poi.xwpf.converter.core.XWPFConverterException:
org.apache.poi.xwpf.converter.core.XWPFConverterException:
com.lowagie.text.DocumentException:
com.lowagie.text.pdf.PdfXConformanceException: All the fonts must be embedded.
This one isn't: Helvetica
at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:59)
at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:37)
at org.apache.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:45)
at pe.edu.rpanaque.docxsunarppdf.ConvertDocx1.main(ConvertDocx1.java:40)
Caused by: org.apache.poi.xwpf.converter.core.XWPFConverterException:
com.lowagie.text.DocumentException:
com.lowagie.text.pdf.PdfXConformanceException: All the fonts must be embedded.
This one isn't: Helvetica
at org.apache.poi.xwpf.converter.pdf.internal.elements.StylableDocument.flushTable(StylableDocument.java:349)
at org.apache.poi.xwpf.converter.pdf.internal.elements.StylableDocument.close(StylableDocument.java:160)
at org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.endVisitDocument(PdfMapper.java:170)
at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.start(XWPFDocumentVisitor.java:196)
at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:55)
... 3 more
Caused by: com.lowagie.text.DocumentException:
com.lowagie.text.pdf.PdfXConformanceException: All the fonts must be embedded.
This one isn't: Helvetica
at com.lowagie.text.pdf.PdfDocument.add(Unknown Source)
at com.lowagie.text.Document.add(Unknown Source)
at fr.opensagres.xdocreport.itext.extension.ExtendedDocument.add(ExtendedDocument.java:114)
at org.apache.poi.xwpf.converter.pdf.internal.elements.StylableDocument.flushTable(StylableDocument.java:345)
... 7 more
Caused by: com.lowagie.text.pdf.PdfXConformanceException: All the fonts must be
embedded. This one isn't: Helvetica
at com.lowagie.text.pdf.internal.PdfXConformanceImp.checkPDFXConformance(Unknown Source)
at com.lowagie.text.pdf.PdfWriter.addSimple(Unknown Source)
at com.lowagie.text.pdf.PdfContentByte.setFontAndSize(Unknown Source)
at com.lowagie.text.pdf.PdfDocument.writeLineToContent(Unknown Source)
at com.lowagie.text.pdf.ColumnText.go(Unknown Source)
at com.lowagie.text.pdf.ColumnText.goComposite(Unknown Source)
at com.lowagie.text.pdf.ColumnText.go(Unknown Source)
at com.lowagie.text.pdf.ColumnText.go(Unknown Source)
at com.lowagie.text.pdf.PdfPRow.writeCells(Unknown Source)
at com.lowagie.text.pdf.PdfPTable.writeSelectedRows(Unknown Source)
at com.lowagie.text.pdf.PdfPTable.writeSelectedRows(Unknown Source)
at com.lowagie.text.pdf.PdfPTable.writeSelectedRows(Unknown Source)
at com.lowagie.text.pdf.ColumnText.goComposite(Unknown Source)
at com.lowagie.text.pdf.ColumnText.go(Unknown Source)
at com.lowagie.text.pdf.ColumnText.go(Unknown Source)
at com.lowagie.text.pdf.PdfDocument.addPTable(Unknown Source)
... 11 more
________________________________________________
thanks all
Original comment by mario...@gmail.com
on 30 Dec 2013 at 9:54
Never played with PDF/A and iText. Perhaps
http://stackoverflow.com/questions/19315917/all-the-fonts-must-be-embedded-this-
one-isnt-helvetica can help you?
Original comment by angelo.z...@gmail.com
on 30 Dec 2013 at 10:55
i need add font styles for i have convert docx to pdf/a
Original comment by mario...@gmail.com
on 30 Dec 2013 at 11:37
I cannot help you more, because never played with PDF/A.
It should be cool if some iText user could help us with this toipc.
Thank's
Original comment by angelo.z...@gmail.com
on 30 Dec 2013 at 11:48
yes, It would be cool .
but you think that you can migrate your project to itext 5.4
,because in this itext's version exists support for the standard pdf/a
thank's.
Original comment by mario...@gmail.com
on 31 Dec 2013 at 12:10
We have choosen to use iText 2.3.7 for the license. Today we have not the
intention (and not the time) to migrate to 5.4.
Original comment by angelo.z...@gmail.com
on 31 Dec 2013 at 12:14
and if I change itext for FOP or PDFBox its possible?
Original comment by mario...@gmail.com
on 31 Dec 2013 at 12:27
Our PDF converter is based on iText 2.3.7 so you cannot change it for FOP or
PDFBox.
We have started a long time an implementation with FOP but we have gaven it
(very slowly, hard to maintain because of XSL, problem with memory, etc). For
PDFBox I don"t know how to create a PDF from scratch. See issues at
https://code.google.com/p/xdocreport/issues/detail?id=33
Original comment by angelo.z...@gmail.com
on 31 Dec 2013 at 8:00
Hello,
When I'm creating a table with apache poi(poi-3.9-20121203.jar):
XWPFTable table = new XWPFDocument().createTable();
System.out.println(table.getCTTbl());
<xml-fragment
xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
" xmlns:w10="urn:schemas-microsoft-com:office:word"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml"
xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk"
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
<w:tblPr>
<w:tblW w:w="0" w:type="auto"/>
<w:tblBorders>
<w:top w:val="single"/>
<w:left w:val="single"/>
<w:bottom w:val="single"/>
<w:right w:val="single"/>
<w:insideH w:val="single"/>
<w:insideV w:val="single"/>
</w:tblBorders>
</w:tblPr>
<w:tr>
<w:tc>
<w:p>
<w:r>
<w:t>Hello</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:p>
<w:r>
<w:t>World</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:tr>
<w:tc>
<w:p>
<w:r>
<w:t>This is</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:p>
<w:r>
<w:t>a table</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</xml-fragment>
******It does not create the xml tag
<w:tblGrid>
<w:gridCol w:w="4360"/>
<w:gridCol w:w="4360"/>
..........
..........
</w:tblGrid>
******* I think this could work so:
indexTable =0; //model existing table in the document, template
CTTblPr ct = document.getTables().get(indexTable).getCTTbl().getTblPr();
table.getCTTbl().setTblPr(ct);
CTTblGrid ctg =document.getTables().get(indexTable).getCTTbl().getTblGrid();
table.getCTTbl().setTblGrid(ctg);
thanks.
Original comment by rtejadapa
on 31 Dec 2013 at 7:29
Attachments:
Ok thank's for this info. If I remember w:tblGrid is important to know width of
table, etc. But no time for the moment to fix that-(
Original comment by angelo.z...@gmail.com
on 1 Jan 2014 at 8:14
Hi rtejadapa,
Have you tried to convert your docx with 1.0.4-SNAPSHOT? I have tested your
docx and it works well with 1.0.4-SNAPSHOT.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 5 Jan 2014 at 4:08
I close this issue because none answer.
Original comment by angelo.z...@gmail.com
on 18 Feb 2014 at 11:11
1.0.4 seems fix the problem.
Original comment by angelo.z...@gmail.com
on 18 Feb 2014 at 11:12
Original issue reported on code.google.com by
timopra...@gmail.com
on 27 Nov 2013 at 10:56Attachments: