Docx4j Issues converting to pdf

半腔热情 提交于 2019-12-13 05:46:40

问题



I know there's a lot of issues in this console report, but since I'm not that expert in docx4j and all the related packages, I' d like to have some explanations, especially on the reason why it is having formatting issues. Please give me some help.

 This is the console output
09:40:08,964 WARN  [org.docx4j.fonts.PhysicalFonts] (http-/0.0.0.0:8080-5) Aborting: file:/C:/Windows/FONTS/impact.ttf (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
09:40:09,025 INFO  [org.docx4j.fonts.RunFontSelector] (http-/0.0.0.0:8080-5) rPrDefault/rFonts referenced Times New Roman
09:40:09,477 INFO  [org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart] (http-/0.0.0.0:8080-5) Writing temp embedded fonts 1441784409477
09:40:09,477 WARN  [org.docx4j.fonts.Mapper] (http-/0.0.0.0:8080-5) Overwriting existing fontMapping: times new roman
1431.919: [GC1431.920: [ParNew: 294580K->34048K(306688K), 0.0955748 secs] 547471K->310588K(1300224K), 0.0957060 secs] [Times: user=0.19 sys=0.03, real=0.09 secs] 
09:41:27,123 INFO  [org.docx4j.fonts.RunFontSelector] (http-/0.0.0.0:8080-5) rPrDefault/rFonts referenced Times New Roman
09:41:27,364 INFO  [org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart] (http-/0.0.0.0:8080-5) Writing temp embedded fonts 1441784487364
09:41:27,374 INFO  [org.docx4j.convert.out.common.preprocess.FieldsCombiner] (http-/0.0.0.0:8080-5) starting
09:41:27,384 INFO  [org.docx4j.convert.out.common.preprocess.CoverPageSectPrMover] (http-/0.0.0.0:8080-5) No need to move sectPr 
09:41:27,514 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId9 points to header1.xml
09:41:27,514 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId10 points to footer1.xml
09:41:27,514 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId11 points to footer2.xml
09:41:27,514 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId9 points to header1.xml
09:41:27,514 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId10 points to footer1.xml
09:41:27,514 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId11 points to footer2.xml
09:41:27,534 INFO  [org.docx4j.fonts.RunFontSelector] (http-/0.0.0.0:8080-5) rPrDefault/rFonts referenced Times New Roman
09:41:27,779 INFO  [org.docx4j.convert.out.common.AbstractConversionContext] (http-/0.0.0.0:8080-5) /pkg:package
1500.214: [GC1500.214: [ParNew: 306688K->34047K(306688K), 0.1032470 secs] 583228K->343685K(1300224K), 0.1033414 secs] [Times: user=0.19 sys=0.02, real=0.10 secs] 
09:41:29,249 INFO  [org.docx4j.fonts.RunFontSelector] (http-/0.0.0.0:8080-5) rPrDefault/rFonts referenced Times New Roman
09:41:29,543 INFO  [org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart] (http-/0.0.0.0:8080-5) Writing temp embedded fonts 1441784489543
09:41:29,553 INFO  [org.docx4j.convert.out.common.preprocess.FieldsCombiner] (http-/0.0.0.0:8080-5) starting
09:41:29,553 INFO  [org.docx4j.convert.out.common.preprocess.CoverPageSectPrMover] (http-/0.0.0.0:8080-5) No need to move sectPr 
09:41:29,553 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId9 points to header1.xml
09:41:29,553 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId10 points to footer1.xml
09:41:29,553 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId11 points to footer2.xml
09:41:29,553 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId9 points to header1.xml
09:41:29,553 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId10 points to footer1.xml
09:41:29,553 INFO  [org.docx4j.openpackaging.parts.relationships.RelationshipsPart] (http-/0.0.0.0:8080-5) rId11 points to footer2.xml
09:41:29,553 INFO  [org.docx4j.fonts.RunFontSelector] (http-/0.0.0.0:8080-5) rPrDefault/rFonts referenced Times New Roman
09:41:29,563 INFO  [org.docx4j.convert.out.common.AbstractConversionContext] (http-/0.0.0.0:8080-5) /pkg:package
09:41:29,583 INFO  [org.docx4j.model.images.AbstractConversionImageHandler] (http-/0.0.0.0:8080-5) Wrote @src='file:/C:/Users/DANILO~1/AppData/Local/Temp/0b3f4416-448a-438b-9c7a-e57c7a513433image1.jpeg
09:41:29,593 INFO  [org.docx4j.model.images.AbstractConversionImageHandler] (http-/0.0.0.0:8080-5) Wrote @src='file:/C:/Users/DANILO~1/AppData/Local/Temp/0b3f4416-448a-438b-9c7a-e57c7a513433image2.jpeg
09:41:29,787 WARN  [org.docx4j.convert.out.common.AbstractConversionContext] (http-/0.0.0.0:8080-5) NOT IMPLEMENTED: support for w:instrText; 
09:41:29,797 WARN  [org.docx4j.convert.out.common.AbstractConversionContext] (http-/0.0.0.0:8080-5) NOT IMPLEMENTED: support for w:instrText; 
09:41:29,818 INFO  [org.docx4j.fonts.RunFontSelector] (http-/0.0.0.0:8080-5) rPrDefault/rFonts referenced Times New Roman
09:41:29,858 INFO  [org.docx4j.fonts.PhysicalFonts] (http-/0.0.0.0:8080-5) No italic form for: Wingdings
09:41:29,858 INFO  [org.docx4j.fonts.PhysicalFonts] (http-/0.0.0.0:8080-5) No italic form for: Symbol
09:41:29,858 WARN  [org.docx4j.convert.out.fo.renderers.FORendererApacheFOP] (http-/0.0.0.0:8080-5) Can't set up FOP svn; org.apache.fop.apps.FopConfParser from [Module "deployment.NetiEar.ear.NetiWeb.war:main" from Service Module Loader]
09:41:30,138 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.

09:41:30,138 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.

09:41:30,138 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

09:41:30,228 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.

09:41:30,228 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

09:41:30,238 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.

09:41:30,238 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

09:41:30,248 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Font "Times New Roman,normal,400" not found. Substituting with "any,normal,400".
09:41:30,288 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.

09:41:30,288 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

09:41:30,288 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.

09:41:30,288 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

09:41:30,288 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1043)
09:41:30,288 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
09:41:30,288 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400".
09:41:30,288 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Font "Times New Roman,normal,700" not found. Substituting with "any,normal,700".
09:41:30,298 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Font "Arial,normal,400" not found. Substituting with "any,normal,400".
09:41:30,308 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.

09:41:30,308 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

09:41:30,308 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:30,338 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 1 in block-progression direction by 549754 millipoints. (See position 1:958)
09:41:30,358 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1043)
09:41:30,368 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:30,378 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 2 in block-progression direction by 549754 millipoints. (See position 1:958)
09:41:30,388 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1043)
09:41:30,408 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:30,408 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 3 in block-progression direction by 549754 millipoints. (See position 1:958)
1502.007: [GC1502.007: [ParNew: 306687K->34048K(306688K), 0.0900753 secs] 616325K->369676K(1300224K), 0.0901621 secs] [Times: user=0.19 sys=0.00, real=0.09 secs] 
09:41:30,518 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1043)
09:41:30,528 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:30,538 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 4 in block-progression direction by 549754 millipoints. (See position 1:958)
09:41:30,648 INFO  [org.docx4j.model.images.AbstractConversionImageHandler] (http-/0.0.0.0:8080-5) Wrote @src='file:/C:/Users/DANILO~1/AppData/Local/Temp/7b2d891a-50f5-4802-8577-ef4c1859f186image1.jpeg
09:41:30,658 INFO  [org.docx4j.model.images.AbstractConversionImageHandler] (http-/0.0.0.0:8080-5) Wrote @src='file:/C:/Users/DANILO~1/AppData/Local/Temp/7b2d891a-50f5-4802-8577-ef4c1859f186image2.jpeg
09:41:30,818 WARN  [org.docx4j.convert.out.common.AbstractConversionContext] (http-/0.0.0.0:8080-5) NOT IMPLEMENTED: support for w:instrText; 
09:41:30,842 WARN  [org.docx4j.convert.out.common.AbstractConversionContext] (http-/0.0.0.0:8080-5) NOT IMPLEMENTED: support for w:instrText; 
09:41:30,952 INFO  [stdout] (http-/0.0.0.0:8080-5) 1.

09:41:30,982 INFO  [stdout] (http-/0.0.0.0:8080-5) 2.

09:41:30,992 INFO  [stdout] (http-/0.0.0.0:8080-5) 3.

09:41:31,002 INFO  [stdout] (http-/0.0.0.0:8080-5) 4.

09:41:31,272 WARN  [org.docx4j.model.properties.paragraph.Indent] (http-/0.0.0.0:8080-5) Only left/first-line indentation is handled at present
09:41:31,272 WARN  [org.docx4j.model.properties.paragraph.Indent] (http-/0.0.0.0:8080-5) Only left/first-line indentation is handled at present
09:41:31,442 WARN  [org.docx4j.model.properties.paragraph.Indent] (http-/0.0.0.0:8080-5) Only left/first-line indentation is handled at present
09:41:31,452 WARN  [org.docx4j.model.properties.paragraph.Indent] (http-/0.0.0.0:8080-5) Only left/first-line indentation is handled at present
09:41:31,642 WARN  [org.docx4j.convert.out.common.AbstractConversionContext] (http-/0.0.0.0:8080-5) NOT IMPLEMENTED: support for w:smartTagPr; 
09:41:31,662 WARN  [org.docx4j.convert.out.common.AbstractConversionContext] (http-/0.0.0.0:8080-5) NOT IMPLEMENTED: support for w:smartTagPr; 
09:41:31,722 INFO  [org.docx4j.convert.out.fo.AbstractFOExporter] (http-/0.0.0.0:8080-5) Saved C:\Users\danilo petrone\Desktop\tmpDocx8474582827974641306.docxDocumento_modificato.fo
09:41:31,722 INFO  [org.docx4j.fonts.RunFontSelector] (http-/0.0.0.0:8080-5) rPrDefault/rFonts referenced Times New Roman
09:41:31,914 INFO  [org.docx4j.fonts.PhysicalFonts] (http-/0.0.0.0:8080-5) No italic form for: Wingdings
09:41:31,914 INFO  [org.docx4j.fonts.PhysicalFonts] (http-/0.0.0.0:8080-5) No italic form for: Symbol
09:41:31,914 WARN  [org.docx4j.convert.out.fo.renderers.FORendererApacheFOP] (http-/0.0.0.0:8080-5) Can't set up FOP svn; org.apache.fop.apps.FopConfParser from [Module "deployment.NetiEar.ear.NetiWeb.war:main" from Service Module Loader]
09:41:32,075 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
09:41:32,075 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400".
1504.039: [GC1504.039: [ParNew: 306688K->34047K(306688K), 0.2034662 secs] 642316K->424256K(1300224K), 0.2035597 secs] [Times: user=0.38 sys=0.00, real=0.21 secs] 
09:41:32,770 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1041)
09:41:32,789 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:32,811 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 1 in block-progression direction by 670 millipoints. (See position 1:956)
09:41:32,811 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-after on page 1 in block-progression direction by 286 millipoints. (See position 3:4954)
09:41:32,901 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.

09:41:32,901 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

09:41:32,901 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.

09:41:32,901 ERROR [stderr] (http-/0.0.0.0:8080-5) Warning:  __redirected.__XMLReaderFactory: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

09:41:32,901 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Rendered page #1.
09:41:32,911 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1041)
09:41:32,921 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:32,931 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 2 in block-progression direction by 670 millipoints. (See position 1:956)
09:41:32,931 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-after on page 2 in block-progression direction by 286 millipoints. (See position 3:4954)
09:41:32,971 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Rendered page #2.
09:41:32,971 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1041)
09:41:32,981 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:32,991 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 3 in block-progression direction by 670 millipoints. (See position 1:956)
09:41:32,991 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-after on page 3 in block-progression direction by 286 millipoints. (See position 3:4954)
09:41:33,022 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Rendered page #3.
09:41:33,032 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1041)
09:41:33,032 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:33,042 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 4 in block-progression direction by 670 millipoints. (See position 1:956)
09:41:33,042 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-after on page 4 in block-progression direction by 286 millipoints. (See position 3:4954)
09:41:33,062 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Rendered page #4.
09:41:33,072 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1041)
09:41:33,072 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:33,082 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 5 in block-progression direction by 670 millipoints. (See position 1:956)
09:41:33,082 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-after on page 5 in block-progression direction by 286 millipoints. (See position 3:4954)
09:41:33,102 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Rendered page #5.
09:41:33,112 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1041)
09:41:33,112 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:33,122 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 6 in block-progression direction by 670 millipoints. (See position 1:956)
09:41:33,122 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-after on page 6 in block-progression direction by 286 millipoints. (See position 3:4954)
09:41:33,142 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Rendered page #6.
09:41:33,152 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1041)
09:41:33,162 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:33,162 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 7 in block-progression direction by 670 millipoints. (See position 1:956)
09:41:33,162 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-after on page 7 in block-progression direction by 286 millipoints. (See position 3:4954)
09:41:33,182 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Rendered page #7.
09:41:33,192 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1041)
09:41:33,192 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:33,202 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 8 in block-progression direction by 670 millipoints. (See position 1:956)
09:41:33,202 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-after on page 8 in block-progression direction by 286 millipoints. (See position 3:4954)
09:41:33,222 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Rendered page #8.
09:41:33,222 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Line 1 of a paragraph overflows the available area by more than 50 points. (See position 1:1041)
09:41:33,222 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) An fo:table  (See position 3:425) is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)
09:41:33,232 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-before on page 9 in block-progression direction by 670 millipoints. (See position 1:956)
09:41:33,232 WARNING [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Content overflows the viewport of the fo:region-after on page 9 in block-progression direction by 286 millipoints. (See position 3:4954)
09:41:33,242 INFO  [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:8080-5) Rendered page #9.
09:41:33,292 INFO  [it.led.neti.common.logutente.LogUtenteEngine] (http-/0.0.0.0:8080-5) 
public void docx2PDF(String filePath){

        String regex = ".*(calibri|camb|cour|arial|times|comic|georgia|impact|LSANS|pala|tahoma|trebuc|verdana|symbol|webdings|wingding).*";
        PhysicalFonts.setRegex(regex);

        FieldUpdater updater = new FieldUpdater(wordMLPackage);
        try {
            updater.update(true);
        } catch (Docx4JException e) {
            logger.error("Errore nel preprocessing PDF ");
        }
        Mapper fontMapper = new IdentityPlusMapper();
        try {
            wordMLPackage.setFontMapper(fontMapper);
        } catch (Exception e) {
            logger.error("Errore nel inserimento del Font Mapper");
        }

        PhysicalFont font = PhysicalFonts.get("Times New Roman"); 

        if (font != null) {
            fontMapper.put("Times New Roman", font);
        }



        FOSettings foSettings = Docx4J.createFOSettings();
        if (true) {
            foSettings.setFoDumpFile(new java.io.File(filePath + "Documento_modificato.fo"));
        }
        foSettings.setWmlPackage(wordMLPackage);
        //foSettings.setApacheFopMime(FOSettings.INTERNAL_FO_MIME);


        OutputStream os;
        try {
            os = new java.io.FileOutputStream(filePath+"Documento_modificato.pdf");
            Docx4J.toFO(foSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL);
        } catch (FileNotFoundException e1) {
            logger.error("File non trovato");
        } catch (Docx4JException e) {
            logger.error("Errore Nell'esportazione del PDF");
        }

Thank you very much.


回答1:


Now I have a workaround that is reasonable to be used.
For those who's experiencing runtime issues between JBoss (JBoss EAP 6.3.0.GA (AS 7.4.0.Final-redhat-19)) modules (which contain jar files) and the same (or different versions) jars, spread all over your lib's directories:
in this specific case, the problem was related to Xalan module and Xerces module whose jars were conflicting with those belonging to the docx4J module (which has Xalan, Serializer as dependences).
So I removed the reference to the jars, in both module.xml file related to Xalan and Xerces modules. Once you have your Docx4j module, with all dependences, you are done.

Next step will be to tell JBoss not to load Xalan and Xerces, from the Docx4J module, or from, somewhere else, like the JBoss-deployment-structure.xml, so that you'll be able to load the correct libraries, without affecting those part of your software that are still linked to the modules that you made empty. (Don't know yet).



来源:https://stackoverflow.com/questions/32474158/docx4j-issues-converting-to-pdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!