PDF Shipping Order from Rails...BOUNTY

Hello Rails Community,

I put this request out to the community a few weeks ago and got one
reply and he ended up being too busy to do it.

So, let me try again. I have a need to generate a shipping order from
an application that is rails driven. All the data for the shipping
order is contained within two tables. I feel like it it too cumbersome
to map out all the coordinates for the data and the frames, etc… My
thought was that maybe a simpler way existed to do it - but based on my
lack of response perhaps I am incorrect.

I have a sample of the shipping order. You can use your own system to
generate it, just please make sure you have placeholders where all the
database stuff goes so that I can easily change it out. E.g. - If a
cell has the order number, then i would expect to see something like
@order.order_number in the file you deliver to me so that I can map it
to my own database columns.

Please reply to me directly if you can help and let me know how much
you will charge for this task and what kind of time frame you can
deliver it in. My need is pretty immediate because right now I’m doing
it by connecting OpenOffice Writer to the mysql db and then exporting to
PDF. I would much rather click a button from the rails app and have
this done for me.

Many thanks in advance to anyone who can help. The PDF::Writer
samples are great but I need something more than Hello World and don’t
have the time to map out all the coordinates for everything! Maybe I’m
going about this all wrong! Suggestions?

Thanks,

Michael

Michael

You could have more success on http://www.rentacoder.com
(send an invitation to all the people with “ruby” in their profile)

Alain

Thank you Alain…

Michael

Alain R. [email protected] wrote:
Michael

You could have more success on http://www.rentacoder.com
(send an invitation to all the people with “ruby” in their profile)

Alain


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Actually, the question in this thread is an interesting one… Is there
a better way to use PDF::Writer than to provide specific coordinates for
everything?

On the wiki page, HTMLDOC is suggested. Why isn’t this a more common
solution? It seems like it provides a better answer – it can produce
PDF directly but has the benefit of formatting like tables and so on.
PDF::Writer seems difficult to use because everything must be placed
manually.

So Michael-- why not use HTMLDOC? I presume you’re already writing
HTML.

BTW – I will need to generate PDFs here shortly and am not yet fully
informed on the subject. I’m trying to decide why you want to use
PDF::Writer over HTMLDOC.

Jake

Michael wrote:

Hello Rails Community,

I put this request out to the community a few weeks ago and got one
reply and he ended up being too busy to do it.

Jake,

I’m not using HTMLDoc because when I looked at the documentation on
it, it appeared to be a program that runs in the background (or similar)
and I just wanted something quick and simple to call, execute, finish.
Perhaps I have it wrong, but it sure reminded me of an acrobat type of
application (like distiller) that runs batch mode/single item mode in
the background and I didn’t want this.

PDF::Writer seems like the logical choice for me - but it would be
nice if it were easier to use. Perhaps others would argue with this
and it may just be my own ignorance.

In my dream world, here is what would happen:

  1. I could create a PDF, pieces at a time. E.g. - I would give an
    HTML string/file as a header, another html string/file as a footer, and
    several html strings in the middle. Or, just one big HTML string would
    be fine too. It would parse the html, pull in the images as necessary
    and create a PDF document for me. It would take care of positioning of
    all the data. It would create page breaks as necessary or allow me to
    specify hard breaks with some sort of special delimiter, method call,
    etc… It would read in all the font information as specified in the
    html/css style sheet.

  2. I could give an output path and file name to put the completed
    document. Then, when it is done doing its thing, I could redirect the
    browser to that page. Better yet, I could just navigate to an
    action/view and when that action completes it has the pdf in the browser
    for me (like an rhtml file but instead it loads a pdf).

  3. I could have a " pdf template" and just supply it with an array of
    values to do string substitution. This would avoid the necessity to
    create a complete PDF each time. Instead, it would use a template pdf
    document and replace appropriate values with the values supplied in the
    array/hash.

  4. It would be so easy to use that even I could use it! :slight_smile:

That’s my wish list! If it is already in one of these products AND
the products are licensed MIT/GNU Public/etc… then please someone
chime in and save me from my ignorance.

Thanks,

Michael

On 20/12/05, Jake J. [email protected] wrote:

Actually, the question in this thread is an interesting one… Is there
a better way to use PDF::Writer than to provide specific coordinates for
everything?

On the wiki page, HTMLDOC is suggested. Why isn’t this a more common
solution? It seems like it provides a better answer – it can produce
PDF directly but has the benefit of formatting like tables and so on.
PDF::Writer seems difficult to use because everything must be placed
manually.

The wiki page, in this case, is probably wrong. For highly formatted
documents, yes, you do have to place certain things and you’ll have to
manipulate margins. But if you haven’t, already, look at the manual
for PDF::Writer.

PDF::Writer has supported tables for a long time. Before it was 1.0,
even. I have been asked to do some work to help other things, but I am
extremely busy at work and have had exactly zero time even for
critical PDF::Writer releases (1.1.4).

-austin

Austin Z. * [email protected]
* Alternate: [email protected]

The wiki page, in this case, is probably wrong. For highly formatted
documents, yes, you do have to place certain things and you’ll have to
manipulate margins. But if you haven’t, already, look at the manual
for PDF::Writer.

PDF::Writer has supported tables for a long time. Before it was 1.0,
even. I have been asked to do some work to help other things, but I am
extremely busy at work and have had exactly zero time even for
critical PDF::Writer releases (1.1.4).

-austin

Austin-

I had a chance to look more in-depth at PDF::Writer today. Odd that I
never have time to do anything until I absolutely must. In any case, I
agree – I think your PDF::Writer does handle most of the stuff I
thought it couldn’t.

I’m anxious to try it out now and see if I can get good results without
too much manual labor. I will be producing somewhat simple, but dynamic
forms that depend heavily on user input. I’m curious to see how it
handles them.

Jake

On 12/21/05, Jake J. [email protected] wrote:

-austin
too much manual labor. I will be producing somewhat simple, but dynamic
http://lists.rubyonrails.org/mailman/listinfo/rails

I have used HTMLDOC and PDFWriter. HTMLDOC will not currently process
style sheets, so depending upon how you format things this may be a
significant issue (was for me). PDFWriter is defiantly more work
(especially if you already have formatted HTML), but you get very
precise control over the layout. Additionally, if you do your work
right with PDFWriter you write a helper class that makes the job
easier the next time (like the table stuff).

Thanks Austin :slight_smile:

pth