Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: PDF::API2 Questions

by akwe-xavante (Novice)
on Mar 15, 2012 at 10:16 UTC ( #959761=note: print w/replies, xml ) Need Help??


in reply to Re: PDF::API2 Questions
in thread PDF::API2 Questions

Thank you everybody for your input and advice.

Already spent a good few hours working out how to get data from a HTML Webform into the CGI script then getting that info into a simple unstructured / formatted PDF document and then attaching the PDF document to an email using user info such as the persons name and email address and all's working a treat so far.

The mail recipient is recieving the email and the attachment with the data i put into the PDF document.

Very Happy So Far

I've decided that i will need to get roughly a minimum of 43 bits of data into the PDF document and upto a maximum of 53 parts of info, this includes one perhaps two images / logo's. Some of the data is blocks of text. I haven't tried to get an image in yet, that's todays task

Today's task is also to find out how to get clickable links in there, "Go to MyWebsite" "send MeAnEmail"

Today's task is also to work out / research how to position this data in a specific location on the page

Wish me luck!

Replies are listed 'Best First'.
Re^3: PDF::API2 Questions
by Eliya (Vicar) on Mar 15, 2012 at 10:35 UTC
    Some of the data is blocks of text...

    Don't know whether you've already come across PDF::TextBlock (based on PDF::API2) — it can make life easier with respect to automatic text wrapping/justification, etc.

      I'm my question is a really silly but i have my problem that i've failed to resolve even after googling it a number of times

      How on earth do you get a correct character into a PDF document without letter A in front of it?

      How do get all the special characters even?

        How do get all the special characters even?

        Primarily, you need a font that supports the desired character(s) (= does have a glyph for it).  And with characters outside of the Latin-1 range ('' is not one of them), you want to use Unicode, which (according to my tests) means you can't use the core fonts any longer, but need to switch to using TrueType fonts, for example (see also Re^2: PDF::API2 / unicode characters).

        Depending on where the special characters are coming from - i.e. from literal strings within the source, from files outside of the program, etc. - you need to use utf8 (when your source is UTF-8 encoded), and maybe use feature 'unicode_strings' (avoids a number of more subtle legacy issues and ambiguities with Perl's handling of Unicode (works with newer perls only)), and/or set the PerlIO encoding layer correctly for the respective file handles that the special character are read from.

        As for the letter A in front of (I suppose you really meant ), the problem most likely is that your source code is in UTF-8, but you did not tell Perl about it (see paragraph above) — the UTF-8 encoding of the pound sign is the two bytes \xc2 \xa3, which when incorrectly interpreted as two Latin-1 characters, renders as '£'.

      I'm my question is a really silly but i have my problem that i've failed to resolve even after googling it a number of times.

      How on earth do you get a correct character into a PDF document without letter A in front of it?

      How do get all the special characters even?

        Thank you, adding use utf8 sorted it for me

        Thank you

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://959761]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2018-07-22 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (455 votes). Check out past polls.

    Notices?