in reply to Seeking Comments & Feedback on Word/PDF project

The goal here is to eliminate LaTeX from the process.
Don't do it. LaTeX takes all the pain out of lay-outing.

If you go the Word-way you will have to do the lay-outing yourself and you will be fighting Word's "good intentions" do to things its own way, every inch of the road.

"Printing" straight to PDF is a total nightmare, you will not only have to invent your own layout, but you will have to place all PDF's elements pixel-perfect on every page, calculate the size of all paragraphs, do your own page-setting, splitting paragraphs so they fit on the page, ...

Invest some time in learning a modern LaTeX lay-out package, such as memoir (link to the memoir manual in PDF).

I have been using this for several years now and it works like a charm. The data goes from the database into a Perl program which invokes a Template Toolkit template to write the LaTeX-file which is then handed over to latexmk which runs LaTeX the required number of times to resolve all references and turn it into a beautiful PDF.

Believe me, all my previous "solutions" never worked as smoothly as this and I have high level control at all stages of the process.

Update: Almost forgot, bookmarks to all chapters, sections, subsections, references, tables, figures, footnotes, bibliographic items, ... come for free if you use LaTeX and the hyperref package: see this.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

  • Comment on Re: Seeking Comments & Feedback on Word/PDF project

Replies are listed 'Best First'.
Re^2: Seeking Comments & Feedback on Word/PDF project
by jedikaiti (Hermit) on Mar 17, 2010 at 20:04 UTC

    When I talk about using Word, I mean using Template Toolkit to generate a few XML files that get zipped into a Word .docx file.

    If I kept LaTeX, I would still have to fight it to make it look like the existing Word template (the existing scripts use an outdated format).

    I also have no choice in keeping LaTeX - nobody on my team wants anything to do with it, and being the temp, even if I did want it, I couldn't keep it.

    Kaiti

      It appears these folks like Word, have a standard template that will set margins, and paragraph formats, fonts and all that stuff. I would be thinking along the lines of using Win32::OLE and control WinWord from Perl to insert your data into their template. The result will be a standard WinWord doc that you can direct Word to print as .pdf, XML or whatever. Trying to create a Winword doc yourself is a nightmare as will creating a .pdf that will have same look as their document format.

      I don't know complex this data/project is, but in the past I had one project where I wrote a Word macro that imported my data file, whopped on it and produced a report. The pre-processing was just enough for this Word macro to do its job. So it wasn't necessary for me to write Perl to control Word, just make a file simple enough that my Word Macro could use. Just an idea to consider...

        I'll have to look into that, thanks! That's a really good idea, and one that hadn't even occurred to me.

        Kaiti