in reply to PDF::API2 Questions

Hello guys, I am trying to open pdf and write something to it and save new pdf. There is a problem when i am writing text to the pdf encoded in utf8. The text doesn't look as it should.
my $utftext=qq(SOme UTF text); #$utftext=encode("utf8", decode("cp1251", $utftext) ) ; #$utftext=encode("utf8", $utftext ) ; my $pdf; $pdf = PDF::API2->open('first.pdf'); my $page_number = 1; my $page = $pdf->openpage($page_number); my $font = $pdf->corefont('Verdana');# ,-encoding => 'utf8' my $text = $page->text(); $text->font($font, 30); $text->translate(359, 713); $text->text("$utftext"); $pdf->saveas('mysaved.pdf');

Replies are listed 'Best First'.
Re^2: PDF::API2 Questions
by akwe-xavante (Acolyte) on Mar 16, 2012 at 14:36 UTC

    I'm having another formatting issue or probably an issue placing data onto the page in the PDF document.

    I have a column of numbers with decimal places, in each row the number may have a different number of decimal places before the Dot

    Data is placed on the page achored in the bottom left corner so the vertical alignment of the numbers do not line up

    Is there a simple way for me to get these numbers aligned vertically about the dot in the column of numbers

    Not sure i described my problem very well but hoping somebody knows what i'm trying to achieve and help somehow

      Worked it out

      $txt->text_right(Hello World);

        Is it possible to temporarily write something to the browser whilst a PDF document is created and error checking takes place then replace what has been displayed to the browser using perl?