in reply to Write To PDF File

I'm not aware of a way to use write to output in pdf format. Maybe take a look at PDF::API2 or PDF::Create.

Replies are listed 'Best First'.
Re^2: Write To PDF File
by Zoomie (Novice) on Jun 28, 2012 at 20:27 UTC

    Thanks FrozenWithJoy for your reply...

    I did look at that module and it seems to require you to save the report into a text file first, then read that text file and write to a pdf.

    Just wondering if there's a direct way to print to a pdf file.

      I wrote a quick script based on the documentation from PDF::API2 and it works fine without using an intermediate file:

      #!/usr/bin/env perl use strict; use warnings; use PDF::API2; # Create a blank PDF file my $pdf = PDF::API2->new(); # Add a blank page my $page = $pdf->page(); # Set the page size $page->mediabox('Letter'); # Add a built-in font to the PDF my $font = $pdf->corefont('Helvetica-Bold'); # Add some text to the page my $text = $page->text(); $text->font($font, 20); $text->translate(200, 700); $text->text('Hello World!'); # Save the PDF $pdf->saveas('new.pdf');
      A reply falls below the community's threshold of quality. You may see it by logging in.
      A reply falls below the community's threshold of quality. You may see it by logging in.