Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Generating formetted documents in Perl

Reply
Thread Tools

Generating formetted documents in Perl

 
 
Russel Dalenberg
Guest
Posts: n/a
 
      06-03-2005
I'm trying to write a Perl program that will output a simple catalog. I'd
like to produce something nicer than raw text output.

I have entries with three fields, and I want to be able to display the
fields in columns. I'd like to provide headers and footers with page
numbers (in alternating corners for even/odd pages, if possible). It would
also be really nice if I could include a horizontal line between some of
the entries. I don't need much in the way of fonts, just a couple of
sizes, and maybe bold and italic.

I want the program to be portable between systems (Windows and Linux
presently, Mac OSX eventually), and the output format as well. Ideally,
I'd like to create an output file that the user can bring to his local
print shop to get printed.

I looked through CPAN some, and found RTF::Writer and PDF::Create, but
neither seems to be easy to use, or able to give me the type of output I'm
looking for. This seems strange since I think the page format I'm trying
to produce is pretty simple.

Am I just missing something with the RTF and PDF packages, or is there some
other way that I should use to generate formatted output. I'm about ready
to say "heck with it" and see if I can generate troff files.

Any pointers to documentation that might help, or examples that help me
figure out how to do the formatting would be greatly appreciated!

--
Russel Dalenberg
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
ioneabu@yahoo.com
Guest
Posts: n/a
 
      06-03-2005


Russel Dalenberg wrote:
> I'm trying to write a Perl program that will output a simple catalog. I'd
> like to produce something nicer than raw text output.
>
> I have entries with three fields, and I want to be able to display the
> fields in columns. I'd like to provide headers and footers with page
> numbers (in alternating corners for even/odd pages, if possible). It would
> also be really nice if I could include a horizontal line between some of
> the entries. I don't need much in the way of fonts, just a couple of
> sizes, and maybe bold and italic.
>
> I want the program to be portable between systems (Windows and Linux
> presently, Mac OSX eventually), and the output format as well. Ideally,
> I'd like to create an output file that the user can bring to his local
> print shop to get printed.



Would generating html tables be adequate? Your users can print them
from their browsers.

Look at CGI.pm if you want to do it in Perl.

wana

 
Reply With Quote
 
 
 
 
Russel Dalenberg
Guest
Posts: n/a
 
      06-03-2005
(E-Mail Removed) wrote:

> Russel Dalenberg wrote:
>
>>I'm trying to write a Perl program that will output a simple catalog. I'd
>>like to produce something nicer than raw text output.

>
> Would generating html tables be adequate? Your users can print them
> from their browsers.
>
> Look at CGI.pm if you want to do it in Perl.


The final catalog would be 100+ pages in length, which is why I wanted to
generate a platform-independant output file that could be printed at a
local print shop.

--
Russel Dalenberg
(E-Mail Removed)
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      06-03-2005
Russel Dalenberg <(E-Mail Removed)> wrote:

> I'm trying to write a Perl program that will output a simple catalog. I'd
> like to produce something nicer than raw text output.


> fields in columns. I'd like to provide headers and footers with page
> numbers (in alternating corners for even/odd pages, if possible).


> or is there some
> other way that I should use to generate formatted output.



I'd generate *structured* output from your Perl (or other) program,
and have some other program format that for me.


> and see if I can generate troff files.



I'd generate XML, perhaps in a catalog-specific schema or even
in DocBook, and let one of the bazillion XML processors turn it
into PDF, or troff or HTML or...


--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Scott Bryce
Guest
Posts: n/a
 
      06-04-2005
Russel Dalenberg wrote:
> I'm trying to write a Perl program that will output a simple catalog.
> I'd like to produce something nicer than raw text output.


It sounds like PDF would be the way to go. You can do what you want to
do in perl, but you will either need a basic understanding of the PDF
spec, or PDF creation software. Ask your question in comp.text.pdf and
see what answers you get there.

RTF will not necessarily give you the same look across platforms, since
RTF relies on fonts available on the system. PDF has enough standard
fonts to meet your needs.
 
Reply With Quote
 
Russel Dalenberg
Guest
Posts: n/a
 
      06-07-2005
Tad McClellan wrote:

> Russel Dalenberg <(E-Mail Removed)> wrote:
>
>>I'm trying to write a Perl program that will output a simple catalog. I'd
>>like to produce something nicer than raw text output.

>
>>fields in columns. I'd like to provide headers and footers with page
>>numbers (in alternating corners for even/odd pages, if possible).

>
>>or is there some
>>other way that I should use to generate formatted output.

>
>
> I'd generate *structured* output from your Perl (or other) program,
> and have some other program format that for me.


Humm ... the first part is pretty easy; the input is already pretty
structured to begin with. But I was really hoping not to have to depend on
any other software to generate the final document. Maybe that's not as
easy as I had hoped.

>>and see if I can generate troff files.

>
> I'd generate XML, perhaps in a catalog-specific schema or even
> in DocBook, and let one of the bazillion XML processors turn it
> into PDF, or troff or HTML or...


I don't know much about XML. From what I can see, generating simple XML
from my input data would be easy, but how does that give me paginated
output? I only mentioned troff because long ago and far away I used to
generate documents by hand that way, and I know it can handle pages with
headers and footers.

--
Russel Dalenberg
(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No more stuff on C:\Documents and Settings\[User]\My Documents\Visual Studio 2005\ craigkenisston@hotmail.com ASP .Net 1 10-18-2006 03:31 PM
Generating XML comment documents from ASP.NET C# code-behind =?Utf-8?B?bmV0Y29tbWFuZGVy?= ASP .Net 1 01-25-2006 09:56 AM
generating extremely large PDF documents with FOP Ruchi Dayal XML 1 09-07-2004 06:43 AM
convert word documents using Perl Zak Chababe Perl 0 07-12-2003 02:11 AM



Advertisments