Page 1 of 1

PDF outPut : text too long on

PostPosted: Thu Nov 06, 2014 2:45 am
by khaled2108
hello together,

we i try to insert a long text using doc4j :

*word is auto-sizing but no in PDF conversion

is there a method to solve this problem ?

***** code used to convert word to pdf :


File outputfilepath = new File("main" + ".pdf");

OutputStream out = new FileOutputStream(outputfilepath);
Mapper fontMapper = new IdentityPlusMapper();
PhysicalFont font = PhysicalFonts.getPhysicalFonts().get("Times New Roman");
// make sure this is in your regex (if any.)!!!
if (font != null) {
fontMapper.getFontMappings().put("Times New Roman", font);
fontMapper.getFontMappings().put("Arial", font);
}
fontMapper.getFontMappings().put("Libian SC Regular", PhysicalFonts.getPhysicalFonts().get("SimSun"));
wordMLPackage.setFontMapper(fontMapper);
FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setFoDumpFile(new java.io.File("main.fo"));
foSettings.setWmlPackage(wordMLPackage);
foSettings.setImageIncludeUUID(true);
Docx4J.toFO(foSettings, out, Docx4J.FLAG_EXPORT_PREFER_XSL);


HelloWord11.docx
word output
(4.41 KiB) Downloaded 386 times


main.pdf
pdf result
(14.49 KiB) Downloaded 517 times

Re: PDF outPut : text too long on

PostPosted: Fri Nov 14, 2014 7:15 pm
by jason

Re: PDF outPut : text too long on

PostPosted: Fri Nov 21, 2014 2:56 pm
by aguna
Hi,

Using FOsettings how to wrap the text,
How we can modify the .fo file content.
Can you provide some examples.