# PDF Shipping Order from Rails...BOUNTY

**URL:** <https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685>\
**Category:** Rails\
**Created:** [December 19, 2005, 11:09pm UTC](https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685 "2005-12-19T23:09:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [December 19, 2005, 11:09pm UTC](https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685/1 "2005-12-19T23:09:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [December 20, 2005, 11:32am UTC](https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685/2 "2005-12-20T11:32:53Z")

</div>

Michael

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

Alain

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [December 20, 2005, 4:57pm UTC](https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685/3 "2005-12-20T16:57:48Z")

</div>

Thank you Alain…

Michael

Alain R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
Michael

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

Alain

* * *

Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [December 20, 2005, 10:08pm UTC](https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685/4 "2005-12-20T22:08:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [December 21, 2005, 12:40am UTC](https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685/5 "2005-12-21T00:40:27Z")

</div>

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! 🙂

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

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [December 21, 2005, 12:52am UTC](https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685/6 "2005-12-21T00:52:35Z")

</div>

On 20/12/05, Jake J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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. \* removed\_email\_address@domain.invalid  
\* Alternate: removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [December 21, 2005, 6:42am UTC](https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685/7 "2005-12-21T06:42:40Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [December 21, 2005, 9:37pm UTC](https://www.ruby-forum.com/t/pdf-shipping-order-from-rails-bounty/50685/8 "2005-12-21T21:37:10Z")

</div>

On 12/21/05, Jake J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > -austin  
> > too much manual labor. I will be producing somewhat simple, but dynamic  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](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 🙂

pth
