Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Creation of PDF

by tobias_hofer (Friar)
on Jun 05, 2013 at 07:07 UTC ( #1037145=perlquestion: print w/replies, xml ) Need Help??
tobias_hofer has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I am asked to generate nice looking PDF files from test-reports which are given in XML style.

On CPAN there are some PDF libraries available i.e. PDF::Create.

I found also the DocBook stuff on internet, for DocBook I have to get the XML TestReport into a kind of "DocBook-Style". But the DocBook toolchain is a bit complex I feel, and users got to have the toolchain installed (normally they only have perl installed).

For a big TestResult the text formatting in the CPAN PDF lib seems not to be that easy and I do not know the limitations, so it would be fine if I could change the layout of DIN A4 from portrait to landscape.

Does anyone have some experience with PDF creation and can recommend me some libs or tools which go together well with perl? Any recommendations are highly welcome!

Best regards

Replies are listed 'Best First'.
Re: Creation of PDF
by karlgoethebier (Prior) on Jun 05, 2013 at 08:05 UTC

    Consider using <oXygen/>.

    Think about this:

    Please see also: dblatex.

    Update: XSLT.

    Update 2:

    «But the DocBook toolchain is a bit complex...»

    Nothing but the truth, it's my favorite candidate for the "Greatest Shit I Was Forced To Do In My Live" award.

    Next candidate is a customized Oracle setup...;-)

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      I will have a closer look on XSLT and dblatex.
      Thanks a lot!
Re: Creation of PDF
by rnewsham (Chaplain) on Jun 05, 2013 at 10:47 UTC
    I have had some success creating pdf documents with HTML::HTMLDoc. It provides an interface to htmldoc It does not appear to be actively maintained, or as fully featured as I would like, but it is simple and effective.
Re: Creation of PDF
by eco (Novice) on Jun 05, 2013 at 07:31 UTC

    Depending on requisites, you may also consider going through Perl->LaTeX->PDF.



      LaTeX is definitely an option. Also a LaTeX template could be used for simply putting test results into it... I will check this! Thanks a lot!
      Please, do not put your answer into the signature part. For some monks (e.g. me) it is unreadable.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: Creation of PDF
by kcott (Chancellor) on Jun 05, 2013 at 19:50 UTC

    G'day Tobias,

    While it's been a few years since I used it, I found PDF::API2::Simple allowed me to create PDFs quickly with a minimal learning curve.

    It aggregates a PDF::API2 object which you can acces via the pdf method. You'll need this for more advanced/complex features such as changing orientation:

    $ perl -Mstrict -Mwarnings -E ' use PDF::API2::Simple; my $pdf = PDF::API2::Simple::->new(); $pdf->pdf->page->rotate(90); '

    Of course, you can dive in at the deep end and use PDF::API2 from the outset.

    -- Ken

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1037145]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2018-01-23 14:01 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (246 votes). Check out past polls.