Page 1 of 1

There is no carriage return in my pdf generated

PostPosted: Wed Jul 15, 2015 8:59 pm
by Alf
Hello

I have tried to generate a pdf document with a docx document.

My code

File xdcocFile = new File(pathDocumentWord);
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(xdcocFile);
OutputStream out = new java.io.FileOutputStream(pathDocumentPDF);
Docx4J.toPDF(wordMLPackage,out);

The code works but the generated pdf doesn´t have the carriage returns that the docx have.

Can somebody help me

Thanks for your attention . Regards.

Re: There is no carriage return in my pdf generated

PostPosted: Wed Jul 15, 2015 10:19 pm
by jason
You'll need to post your docx.

Re: There is no carriage return in my pdf generated

PostPosted: Thu Jul 16, 2015 12:42 am
by Alf
Hello

This is my word document.


Thanks

Re: There is no carriage return in my pdf generated

PostPosted: Thu Jul 16, 2015 1:56 am
by Alf
the same result when save to FO.

File xdcocFile = new File(pathDocumentoWord);
WordprocessingMLPackage wordMLPackage;

try {
wordMLPackage = WordprocessingMLPackage.load(xdcocFile);

OutputStream out = new java.io.FileOutputStream(pathDocuemntoPDF);
FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setFoDumpFile(new java.io.File(pathDocuemntoPDF));
foSettings.setWmlPackage(wordMLPackage);
Docx4J.toFO(foSettings, out, Docx4J.FLAG_EXPORT_PREFER_XSL);


} catch (Docx4JException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Re: There is no carriage return in my pdf generated

PostPosted: Tue Jul 21, 2015 3:02 pm
by jason
I've attached the results of converting to PDF via FO.

Could you please indicate which carriage returns are missing?