# Modules for PDFs especially tables.

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

•  Subject
• Author
• Posted on

I want to produce a PDF containing two tables side by side. Each 51
rows (including a header) by three columns. Columns 1 and 2 in each
table are to contain centred text, and column three is to be
left-aligned.

I've been experimenting with PDF::API2, and PDF::Table, but PDF::Table
doesn't appear to do centred text, and PDF::API2 is hard work - the
documentation leaves a lot to be desired, for example, surfing the web
for hints on using PDF::API2 I find references to methods not mentioned
in the PDF::API2 documentation.

Does anyone have any suggestions on how I might proceed? TeX looks like
it might be the best way forward now, I have Lamport's LaTeX book here
so can pull together the relevant TeX/LaTeX commands. I suppose that, if
I can knock up what I want in TeX to start with I won't even need a TeX
module, I can just use some templating.

I'll probably still need Latex::Driver to get my PDF.

Thank you for any suggestions.

Justin.

--
Justin C, by the sea.

## Re: Modules for PDFs especially tables.

Justin C wrote:

Since I know PS better than Tex, I'd just print PS statements directly
and use GS to convert that to PDF.

--------------8<----------------
#!/usr/bin/perl
use strict;
use warnings;

print <<EndPS;
%!PS
/Times-Roman 12 selectfont
100 700 moveto
(Hello) show
showpage

EndPS
--------------8<----------------
Untested - caveat emptor. I have PS boilerplate for centering text etc.

--
RGB

## Re: Modules for PDFs especially tables.

For a project that required XML invoices to be turned into PDF or TIFF I
used two external (to the Perl program this was part of) programs:
AltovaXML (free, closed source) and Apache FOP.  The former because it
was the only free software (albeit closed) I could find that supports
XSLT 2, and Apache FOP to convert XSL-FO to PDF (or TIFF, or several
other formats)

Tables are supported that way (and quite easy IMO).

--
John Bokma                                                               j3b

Hacking & Hiking in Mexico -  http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development

## Re: Modules for PDFs especially tables.

[I did not try direct pdflatex, but] keep in mind that relying on
latex+dvips+ps2pdf (needed since sometimes one needs to add pstops to
the mix) turns out to be prohibitive for deployment.

See documentation of typeset_audio_dir (on CPAN) for workarounds
needed for misconfigured machines (in my experience, much more than
half of them are misconfigured).  And a week ago I found a problem
after an upgrade I just have no clue how to workaround...

Hope this helps,
Ilya

## Re: Modules for PDFs especially tables.

I've done this sort of thing with pdflatex in the past, with good
results. (This is clpm not ctt, but do you know about xetex that knows
Unicode and can find your system's OpenType fonts without needing to be
told?) For templating I'd start with Template::Simple and move to TT if
it proved necessary.

I just used system, with the usual bit of logic to rerun the appropriate
four and a half thousand times until the formatting stabilised, but L::D
looks like a decent encapsulation of that. (L::D can run makeindex
bibtex/etc. of course, which is rather more than is needed for a
situation like this.)

Ben

## Re: Modules for PDFs especially tables.

Justin C wrote:

(uses WebKit) is really nice.

--
Ruud

## Re: Modules for PDFs especially tables.

*SKIP*

I'm afraid that Lamport's book is quiet valuable but somewhat outdated.
I'm not about technical side but about options.  In case you have
'TeX Live' at hands (or near) then

\documentclass
\usepackage[T2A] % possibly you need something else but 'T2A'
\usepackage          % that's what adds utf8 option for input
\usepackage[utf8x]
\usepackage

\begin

\begin
% all the staff here
\end

\end

'longtable' class has clear documentation (with examples) ('texdoc
longtable').  The 'longtable' class extends a stock environment named
'tabular' (this one doesn't span pages).  And you'll be welcome at ctt
(if you provide minimal example that clearly demonstrates your problem
blah-blah-blah) in case of any problems.

--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom

## (La)TeX books

Any tips on more up to date book(s)?

--
John Bokma                                                               j3b

Hacking & Hiking in Mexico -  http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development

## Re: (La)TeX books

No tips, no books.  Books that I've ever spotted (either online or
offline) cover *typesetting* but *programming*.  When I'd asked myself
I've got no answer.  FAQ -> google -> comp.text.tex.  I don't LaTeX, I
just typeset.  Probably I could TeX but that doesn't help with LaTeX (of
any kind) anyway.

--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom

## Re: (La)TeX books

http://www.tug.org/books /

It very much depends on what are your goals.
Guide to LaTeX, 4th Edition by Helmut Kopka and Patrick W. Daly and/or
The LaTeX Companion, 2nd Edition by Frank Mittelbach, Michel Goossens,
Johannes Braams, David Carlisle, and Chris Rowley are usually very
items (including books) listed there, like
http://eijkhout.net/texbytopic/texbytopic.html , is freely available.

If you want something on typesetting in general then get yourself, among
other things, a documentation for 'memoir' class.  It is a book in
itself.

Michal

## Re: (La)TeX books

Michal Jaegermann wrote:

Thanks for posting that, I found a copy at several places including
3rd Edition: http://bit.ly/8zTMsg and
8th Edition: http://bit.ly/Vcrh

As you say, it contains a very good introduction to typesetting for
books. Unfortunately, from a brief glance it appears much of this has
been dropped from the later editions or dispersed into the later content:

Part 1 - Art and Theory
Chapter 1 - The Parts of a Book
Chapter 2 - The Page
Chapter 3 - Picky Points
Chapter 4 - Electronic Books

For an introduction to "typesetting in general" I think the earlier
edition is better.

--
RGB

## Re: (La)TeX books

Changelog for memoir package includes this:
....
Changes (2009/08/23)

o Eighth edition of the User Manual covering memoir v1.61803398.
The design Part is now in a separate document, memdesign, which
should be available from CTAN in /info.

And you know what?  It is there.  Over a hundred pages worth.
http://tug.ctan.org/tex-archive/info/memdesign/memdesign.pdf
http://tug.ctan.org/tex-archive/info/memdesign/memdesign.tex

I guess that I could look closer before posting.

Michal

## Re: Modules for PDFs especially tables.

Thank you to all who replied. Some interesting reading.

I really don't fancy learning PostScript right now, and doing the whole
thing by hand. Maybe I'll save learning PS for another time.

In the end I've had to ditch LaTeX::Driver, I kept getting errors within
the module itself and couldn't figure out how to fix it. In the end I
made a mock-up Tex document, and used it as a template. I'm running
pdflatex from a perl 'system' command... but this has an unwanted

Thanks again for your suggestions, I didn't realise there were so many
different solutions to the problem.

Justin.

--
Justin C, by the sea.

## Re: Modules for PDFs especially tables.

*SKIP*

And you've omitted (or missed) interfaces on (so called) wordprocessors

Sincerly yours, TeX freak

--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom