Modules for PDFs especially tables.

J

Justin C

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.
 
R

RedGrittyBrick

Justin said:
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.

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.
 
J

John Bokma

Justin C said:
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.

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).
 
I

Ilya Zakharevich

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 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
 
E

Eric Pozharski

with said:
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'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{article}
\usepackage[T2A]{fontenc} % possibly you need something else but 'T2A'
\usepackage{ucs} % that's what adds utf8 option for input
\usepackage[utf8x]{inputenc}
\usepackage{longtable}

\begin{document}

\begin{longtable}
% all the staff here
\end{longtable}

\end{document}

'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.
 
E

Eric Pozharski

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

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.
 
M

Michal Jaegermann

John Bokma said:
Any tips on more up to date book(s)?

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
helpful. See also http://www.tug.org/interest.html#doc. Quite a lot of
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
 
R

RedGrittyBrick

Michal said:
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.

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.
 
M

Michal Jaegermann

RedGrittyBrick said:
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:

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
 
J

Justin C

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.

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
side-effect (time for another thread).

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

Justin.
 
E

Eric Pozharski

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

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

Sincerly yours, TeX freak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top