Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Interchange: users

PDF generated invoices etc.

 

 

Interchange users RSS feed   Index | Next | Previous | View Threaded


tverhagen at alamerce

Jun 11, 2009, 9:25 AM

Post #1 of 5 (790 views)
Permalink
PDF generated invoices etc.

Dear All,

I am wondering which applications would work best for generating
complex pdf invoices, preferably on the fly.

Anyone any experience on this subject?

Would be happy to hear from you on this matter.

Currently we are looking at PDFlib. Looks promising but not sure yet
if this library can handle everything we need.

Thanks !

Best regards,

Ton Verhagen

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


david at endpoint

Jun 11, 2009, 10:48 AM

Post #2 of 5 (725 views)
Permalink
Re: PDF generated invoices etc. [In reply to]

> Dear All,
>
> I am wondering which applications would work best for generating
> complex pdf invoices, preferably on the fly.
>
> Anyone any experience on this subject?
>
> Would be happy to hear from you on this matter.
>
> Currently we are looking at PDFlib. Looks promising but not sure yet
> if this library can handle everything we need.

Hi Ton,

I've personally used PDFlib (both the PHP and Perl bindings),
PDF::API2, and I know that some others at End Point have success
making some custom PDF invoicing systems using HTMLDoc's PDF output
option.

Last I looked (which has been a few years), PDFlib was pretty low-
level, which gave you a lot of control over the graphics layout, etc,
but it meant that reports and the like would need to be hand-crafted
or have some other abstraction layer built on top of it.

PDF::API2 is similar in scope/functionality to PDFlib, and has the
same low-level caveats; however as a pure perl implementation freely
available on CPAN it is (for me at least) the more preferable of the
two. (The last I saw, you had to license PDFlib if you wanted to do
anything non-internal with it.) It also had a nicer API to work with,
IMHO.

HTMLDoc has the benefit of being simple to use, but it is difficult to
get the layout/appearance exactly right, plus the version that I have
used does not support alternate character sets/font encodings than the
basic latin-1 which may become an issue.

Some further advice from my colleague Ethan Rowe can be found in the
archives at: http://www.icdevgroup.org/pipermail/interchange-users/2007-July/047692.html
.

Regards,

David
--
David Christensen
End Point Corporation
david [at] endpoint





_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


gert at 3edge

Jun 11, 2009, 10:49 AM

Post #3 of 5 (721 views)
Permalink
Re: PDF generated invoices etc. [In reply to]

> -----Original Message-----
> From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> users-bounces [at] icdevgroup] On Behalf Of Ton Verhagen
> Sent: Thursday, June 11, 2009 7:25 PM
> To: interchange-users [at] icdevgroup
> Subject: [ic] PDF generated invoices etc.
>
> Dear All,
>
> I am wondering which applications would work best for generating
> complex pdf invoices, preferably on the fly.
>
> Anyone any experience on this subject?
>
> Would be happy to hear from you on this matter.
>
> Currently we are looking at PDFlib. Looks promising but not sure yet
> if this library can handle everything we need.
>

http://search.cpan.org/dist/PDF-API2/

Also don't know if it can do what you need, but looks pretty recent (March
2009).

CU,

Gert


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


david at endpoint

Jun 11, 2009, 12:58 PM

Post #4 of 5 (725 views)
Permalink
Re: PDF generated invoices etc. [In reply to]

> I am wondering which applications would work best for generating
> complex pdf invoices, preferably on the fly.

As an addendum, another approach we've taken has been to pre-generate
a PDF with an editable form embedded, and then process through a
toolchain which feeds in the data to the appropriate fields and
flatten the resulting form into regular text fields in the PDF
document. (I believe we used PDF::FDF::Simple and pdftk to do the
respective parts.)

If the changing fields in the document are fixed, this can be a good
compromise, as the source PDF can be created by any document system
that can generate it; additionally the layout/formatting information
for each of the text fields can be set, making it easy to separate
layout from content. However, this approach will fall down when the
number/types of fields on the page are variable (such as an invoice
with a varying number of sub-items), so this may or may not be viable
for your needs. You will also need a program that can create the
editable form in the PDF itself. I just ended up using Acrobat, not
sure what's out there in the OSS arena.

Regards,

David
--
David Christensen
End Point Corporation
david [at] endpoint





_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


peter at pajamian

Jun 11, 2009, 1:10 PM

Post #5 of 5 (723 views)
Permalink
Re: PDF generated invoices etc. [In reply to]

On 06/11/2009 12:58 PM, David Christensen wrote:
>> I am wondering which applications would work best for generating
>> complex pdf invoices, preferably on the fly.
>
> As an addendum, another approach we've taken has been to pre-generate
> a PDF with an editable form embedded, and then process through a
> toolchain which feeds in the data to the appropriate fields and
> flatten the resulting form into regular text fields in the PDF
> document. (I believe we used PDF::FDF::Simple and pdftk to do the
> respective parts.)
>
> If the changing fields in the document are fixed, this can be a good
> compromise, as the source PDF can be created by any document system
> that can generate it; additionally the layout/formatting information
> for each of the text fields can be set, making it easy to separate
> layout from content. However, this approach will fall down when the
> number/types of fields on the page are variable (such as an invoice
> with a varying number of sub-items), so this may or may not be viable
> for your needs. You will also need a program that can create the
> editable form in the PDF itself. I just ended up using Acrobat, not
> sure what's out there in the OSS arena.

I took a similar approach for a client once but instead of starting with
a PDF we started with a .ps file. Since those are directly editable
text I was able to replace sections of the postscript with replaceable
markers and hold the .ps template in memory. Then writing a pdf is as
easy as replacing the appropriate text, writing the file to disk, and
then processing the output file with ghostscript's ps2pdf utility. This
solution turned out to be very fast as only one conversion had to be
done (and ps2pdf is a very fast conversion), so it was ideal for us.

Downsides are all of the above plus issues with character sets being
mapped in different ways for potentially different files to the point
where I had to create a map and search and replace characters on the
input side. This also will clash with UTF8 a bit and cause issues (none
that can't be resolved). Different ps generators tend to generate ps
output that looks vastly different and sometimes you cannot find the
source text in them at all without a deep understanding of ps, also they
tend to generate files of orders of magnitude different sizes. For us
the best solution was to try different generators for the ps until we
found some output that we could work with that wasn't overly bloated.
This may include trying drivers for different postscript printers and
capturing the output to a file.

Good luck,


Peter

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users

Interchange users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.