This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Generating PDF


Dan York <dyork@e-smith.com> writes:

> Yes, I've actually known about 'htmldoc' (from your previous
> postings)... I guess I'm just a perfectionist who wants to go directly
> from XML into PDF.  Since it *can* be done, I want to do it.  (The
> question, of course, is how much hair I want to lose in the process! :-)

Dan,

Seeing as how it sounds like your having problems, I thought I would jot down my proccess and hopefully it will help you a bit.  It's not directly into pdf, as it's converted to tex first, but works well enough for me.  I'm not sure what your running on your computer, but I'll spell out the steps I did on my Debian unstable system.

1. installed the openjade, jadetex, and docbook-stylesheets packages.  I'm using the debian prebuilt packages for simplicity, but I have built them all from source in the past, and they will work that way as well, after you sort out the xml catalog issues.

My XML file's header looks as so:

<?xml version='1.0'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
        "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd";>

2. for chuncked (multi page) html:
    openjade -t sgml -i html -c /usr/share/sgml/docbook/dtd/4.1/docbook.cat\
    -d ~/dsl/custom.dsl#html file.xml

Note that I am not directly specifying the xml.decl stuff like I've ran across several times on the web.  When I do that I get tons of errors, and it works just fine like this.  I do get a few errors saying stuff like simple-page not defined, but works great. If your not using a custom dsl file, point -d at <docbook-stylesheets>/dsssl/docbook/nwalsh/html/docbook.dsl

3. for pdf:
    openjade -t tex -d ~/dsl/custom.dsl#print -o file.tex file.xml

As above if your are not useing a custom dsl file point -d at <docbook-stylesheets>/dsssl/docbook/nwalsh/print/docbook.dsl This also gives me a few lines of erorrs but works fine.

After the tex file is created, I run: 
    pdfjadetex file.tex  
This spews up all kinds of errors, but generates ok.  Most likely after the first time running pdfjadetex, you the page numbers will be all screwed up, but if you rerun it a few more times it will fix them.  I generally run it three times in total.

Some additional notes.

pdfjadetex starts off with rather small buffer sizes.  You will need to find the texmf.cnf and bump up the memory settings if you are going to be dealing with anything larger than 200 pages.  my file is located at: /usr/share/texmf/web2c/texmf.cnf  There is appearently somekind of hardcoded size limit in jadetex though as I'm unable to generate anything larger than around 900 pages no matter how high I set the size limits.  If you create a file named 
jadetex.cfg in the directory your working in and put \LabelElementsfalse in it then it will work splendidly.  I'm not sure what this might affect however, I've built War and Peace at 2,600 pages (9 meg pdf) with this method.

You can also use jade vs. openjade for faster results, however then I don't get bookmarks on my pdfs.

However there is a strange bug somewhere in my process that has recently appeared after I upgraded some packages, now the page numbers restart on the second chapter.  I've been trecking through the source attempting to find it but no luck as of yet.  I'm planning to upgrade to the recently released jadetex and perhaps that will fix it.

I hope some of this is helpfull to you,

Let me know if you have any other questions.
Nathan

BTW, congrats on the Mitel thing, hope everything works out well for you guys there.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]