Forum: Ruby on Rails PDF Shipping Order from Rails...BOUNTY

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5565e460a42fbe5669b458b2753f8d34?d=identicon&s=25 Michael (Guest)
on 2005-12-19 23:09
(Received via mailing list)
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
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2005-12-20 11:32
(Received via mailing list)
Michael


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

Alain
5565e460a42fbe5669b458b2753f8d34?d=identicon&s=25 Michael (Guest)
on 2005-12-20 16:57
(Received via mailing list)
Thank you Alain....

  Michael


Alain Ravet <arav2132@biz.tiscali.be> 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
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
E51c6ae07e72cf04ef869868cb8eca6e?d=identicon&s=25 Jake Janovetz (Guest)
on 2005-12-20 22:08
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.
5565e460a42fbe5669b458b2753f8d34?d=identicon&s=25 Michael (Guest)
on 2005-12-21 00:40
(Received via mailing list)
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
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2005-12-21 00:52
(Received via mailing list)
On 20/12/05, Jake Janovetz <jakejanovetz@yahoo.com> 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 Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca
E51c6ae07e72cf04ef869868cb8eca6e?d=identicon&s=25 Jake Janovetz (Guest)
on 2005-12-21 06:42
> 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
2c51fec8183a5d21c4e11b430beabb47?d=identicon&s=25 Patrick Hurley (Guest)
on 2005-12-21 21:37
(Received via mailing list)
On 12/21/05, Jake Janovetz <jakejanovetz@yahoo.com> 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 :-)

pth
This topic is locked and can not be replied to.