Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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
Tobias

Comment on Creation of PDF
Download Code
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.

    best

    --
    ecocode

      Please, do not put your answer into the signature part. For some monks (e.g. me) it is unreadable.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      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!
Re: Creation of PDF
by karlgoethebier (Priest) 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!
      Tobias
Re: Creation of PDF
by rnewsham (Hermit) 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 http://www.htmldoc.org/. 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 kcott (Abbot) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1037145]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2014-12-26 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls