# Building documentation creates pdf full of ###



## zwieblum (Nov 22, 2019)

I am trying to build the handbooks on a fresh installation, but somehow I end up with a handbook filled with #####.
What I did: followed the instructions given on https://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/book.html , i.e. :

```
pkg install docproj subversion fop
svn checkout https://svn.FreeBSD.org/doc/head ~/doc
cd ~/doc/de_DE.ISO8859-1/books/handbook
make FORMATS="pdf"
```

The resulting PDF looks like this:



The output of 
	
	



```
fop
```
 is like this - which is not very assuring:

```
/usr/bin/env FOP_OPTS="-Xss1024k -Xmx1431552k" /usr/local/bin/fop -c /usr/doc/share/misc/fop.xconf book.fo -pdf book.pdf
Nov 22, 2019 10:51:34 AM org.apache.fop.apps.FopConfParser configure
INFORMATION: Default page-height set to: 11in
Nov 22, 2019 10:51:34 AM org.apache.fop.apps.FopConfParser configure
INFORMATION: Default page-width set to: 8.26in
Nov 22, 2019 10:51:35 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Unable to load font file: file:/usr/local/share/fonts/cantarell/Cantarell-ExtraBold.otf. Reason: java.lang.UnsupportedOperationException: coverage set class table not yet supported
Nov 22, 2019 10:51:35 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Unable to load font file: file:/usr/local/share/fonts/cantarell/Cantarell-Light.otf. Reason: java.lang.UnsupportedOperationException: coverage set class table not yet supported
Nov 22, 2019 10:51:35 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Unable to load font file: file:/usr/local/share/fonts/cantarell/Cantarell-Bold.otf. Reason: java.lang.UnsupportedOperationException: coverage set class table not yet supported
Nov 22, 2019 10:51:35 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Unable to load font file: file:/usr/local/share/fonts/cantarell/Cantarell-Regular.otf. Reason: java.lang.UnsupportedOperationException: coverage set class table not yet supported
Nov 22, 2019 10:51:35 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Unable to load font file: file:/usr/local/share/fonts/cantarell/Cantarell-Thin.otf. Reason: java.lang.UnsupportedOperationException: coverage set class table not yet supported
Nov 22, 2019 10:51:37 AM org.apache.fop.fonts.type1.AFMParser$NotImplementedYet parse
WARNUNG: Support for 'StartTrackKern' has not been implemented, yet! Some font data in the AFM file will be ignored.
Nov 22, 2019 10:51:37 AM org.apache.fop.fonts.type1.AFMParser$NotImplementedYet parse
WARNUNG: Support for 'StartTrackKern' has not been implemented, yet! Some font data in the AFM file will be ignored.
Nov 22, 2019 10:51:37 AM org.apache.fop.fonts.type1.AFMParser$NotImplementedYet parse
WARNUNG: Support for 'StartTrackKern' has not been implemented, yet! Some font data in the AFM file will be ignored.
Nov 22, 2019 10:51:37 AM org.apache.fop.fonts.type1.AFMParser$NotImplementedYet parse
WARNUNG: Support for 'StartTrackKern' has not been implemented, yet! Some font data in the AFM file will be ignored.
Nov 22, 2019 10:51:37 AM org.apache.fop.fonts.type1.AFMParser$NotImplementedYet parse
WARNUNG: Support for 'StartTrackKern' has not been implemented, yet! Some font data in the AFM file will be ignored.
Nov 22, 2019 10:51:37 AM org.apache.fop.fonts.type1.AFMParser$NotImplementedYet parse
WARNUNG: Support for 'StartTrackKern' has not been implemented, yet! Some font data in the AFM file will be ignored.
Nov 22, 2019 10:51:37 AM org.apache.fop.fonts.type1.AFMParser$NotImplementedYet parse
WARNUNG: Support for 'StartTrackKern' has not been implemented, yet! Some font data in the AFM file will be ignored.
Nov 22, 2019 10:51:37 AM org.apache.fop.fonts.type1.AFMParser$NotImplementedYet parse
WARNUNG: Support for 'StartTrackKern' has not been implemented, yet! Some font data in the AFM file will be ignored.
Nov 22, 2019 10:51:37 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: The font directory /usr/local/lib/X11/fonts could not be found.
Nov 22, 2019 10:51:37 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: The font directory /usr/local/share/fonts/TrueType could not be found.
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Glyph "F" (0x46, F) not available in font "Symbol".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Glyph "r" (0x72, r) not available in font "Symbol".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Glyph "e" (0x65, e) not available in font "Symbol".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Glyph "B" (0x42, B) not available in font "Symbol".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Glyph "S" (0x53, S) not available in font "Symbol".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Glyph "D" (0x44, D) not available in font "Symbol".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Glyph "H" (0x48, H) not available in font "Symbol".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Glyph "a" (0x61, a) not available in font "Symbol".
Nov 22, 2019 10:51:38 AM org.apache.fop.events.LoggingEventListener processEvent
INFORMATION: Rendered page #1.
Nov 22, 2019 10:51:39 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Font "Gentium Plus,italic,400" not found. Substituting with "any,italic,400".
Nov 22, 2019 10:51:39 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Font "Symbol,italic,400" not found. Substituting with "Symbol,normal,400".
Nov 22, 2019 10:51:39 AM org.apache.fop.events.LoggingEventListener processEvent
WARNUNG: Font "ZapfDingbats,italic,400" not found. Substituting with "ZapfDingbats,normal,400".
Nov 22, 2019 10:51:39 AM org.apache.fop.events.LoggingEventListener processEvent
INFORMATION: Rendered page #2.
Nov 22, 2019 10:51:39 AM org.apache.fop.events.LoggingEventListener processEvent
INFORMATION: Rendered page #3.
Nov 22, 2019 10:51:40 AM org.apache.fop.events.LoggingEventListener processEvent
INFORMATION: Rendered page #4.
Nov 22, 2019 10:51:40 AM org.apache.fop.events.LoggingEventListener processEvent
INFORMATION: Rendered page #5.
```

Now what am I missing? How can I build the handbook?


----------



## SKull (Nov 22, 2019)

You're missing some fonts.


----------



## zwieblum (Nov 22, 2019)

No, I checked that before:

```
$ pkg info|grep cantarell
cantarell-fonts-0.101_1        Cantarell, a Humanist sans-serif font family
$ ll /usr/local/share/fonts/cantarell/Cantarell-Bold.otf
-rw-r--r--  1 root  wheel  117144 15 März  2018 /usr/local/share/fonts/cantarell/Cantarell-Bold.otf
```


----------



## SKull (Nov 22, 2019)

Hmm...
UnsupportedOperationException
That suggests that the apache.fop version used to build it is either to new, or to old.


----------



## zwieblum (Nov 22, 2019)

Ok, kicked `fop` and tried `dblatex`, This does not work, either:

```
Found png for 'mail/pine4'
Found png for 'mail/pine5'
Found eps for 'advanced-networking/static-routes'
convert /usr/doc/share/images/books/handbook/advanced-networking/static-routes.eps fig7.png
convert: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `fig7.png' @ warning/png.c/MagickPNGWarningHandler/1668.
Found png for 'advanced-networking/pxe-nfs'
Build book.parsed.print.pdf
/tmp/tmpIfO9VC not removed
Unexpected error occured
Error: [Errno 2] No such file or directory
*** Error code 1

Stop.
```

The folder contains:

```
# ll /tmp/tmpIfO9VC
total 2639
-rw-r--r--  1 root  wheel  3057282 22 Nov. 17:10 book.parsed.print.rtex
-rw-r--r--  1 root  wheel  2862390 22 Nov. 17:10 book.parsed.print.tex
-rw-r--r--  1 root  wheel      344 22 Nov. 16:50 custom.xsl
-rw-r--r--  1 root  wheel      332 22 Nov. 16:50 doclist.xsl
-rw-r--r--  1 root  wheel      100 22 Nov. 16:50 env_tex
-rw-r--r--  1 root  wheel     5567 22 Nov. 17:10 fig0.png
-rw-r--r--  1 root  wheel     7067 22 Nov. 17:10 fig1.png
-rw-r--r--  1 root  wheel     7056 22 Nov. 17:10 fig2.png
-rw-r--r--  1 root  wheel     8452 22 Nov. 17:10 fig3.png
-rw-r--r--  1 root  wheel     7232 22 Nov. 17:10 fig4.png
-rw-r--r--  1 root  wheel     9611 22 Nov. 17:10 fig5.png
-rw-r--r--  1 root  wheel    22463 22 Nov. 17:10 fig6.png
-rw-r--r--  1 root  wheel     8179 22 Nov. 17:10 fig7.png
-rw-r--r--  1 root  wheel       77 22 Nov. 16:50 listings.xml
```

Any idea what to do?


----------



## SKull (Nov 22, 2019)

I don't have a real answer here. But my opportunistic approach would be to render it as html, and then use one of the many html to pdf converters.


----------



## zwieblum (Nov 22, 2019)

Well, yes, but the point to render a printable book is to get page numbers and an index that points to pages, leave alone the problem with chapters etc. ...


----------



## shkhln (Nov 22, 2019)

https://issues.apache.org/jira/browse/FOP-2704?focusedCommentId=16318591&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16318591?


----------



## T-Daemon (Nov 22, 2019)

Run `pkg options docproj`, you will see package textproc/docproj is build `FOP: off`  (FOP PDF renderer (requires Java)). You need to build textproc/docproj from ports with that option enabled for a pdf handbook.


----------



## T-Daemon (Nov 22, 2019)

I see you have installed textproc/fop seperate. Sorry I missed that.


----------



## zwieblum (Nov 22, 2019)

No problem. I'm currently building textproc/docproj - maybe ther is a differnce between ports an packages ....


----------



## zwieblum (Nov 22, 2019)

Ok, build from ports fails, too.


----------



## zwieblum (Nov 23, 2019)

shkhln: the patch does not work.


----------



## zwieblum (Nov 23, 2019)

@dblatex: After some tweeking it generates *.pdf for all but handbook. I heed to install textproc/dblatex and print/tex-xetex, then remove the font-spec for _Courier-New_ from share/xml/freebsd-dblatex.xsl. Now I can build almost all books and articles, only the handbook fails. Oh, I like the generated PDF from dblatex better than the output of fob.


----------

