Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: exporting PDF::API2

by Beechbone (Pilgrim)
on Jun 25, 2013 at 10:23 UTC ( #1040580=note: print w/ replies, xml ) Need Help??

in reply to exporting PDF::API2


$font = $pdf->ttfont($fontfile, -encode => 'udf8', -isocmap => 1, -unicodemap => 1);

That's what I use to get copy&paste-able PDFs.

Search, Ask, Know

Comment on Re: exporting PDF::API2
Download Code
Replies are listed 'Best First'.
Re^2: exporting PDF::API2
by tqisjim (Beadle) on Jul 31, 2013 at 17:50 UTC

    Cutting and pasting now works in my PDF file. But C&P did not work in your proposed solution: I had to s/udf/utf/.

    I did a little additional testing: Of the flags in your response, only the -unicodemap seems required. Although the utf8 encoding flag's functionality is clear, the other two flags do not effect embedded text.

    While digging in the source code, I discovered that PDF::API2 sets -unicodemap by default- although PDF::API3::Compat::API2 does not. Sure enough, when I went back and tested with PDF::API2, the text was embedded. Maybe this *is* a bug in PDF::API3::Compat::API2. Even so, I only encountered it trying to fix a bug I didn't have in the first place. :(

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040580]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2015-10-13 08:14 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (296 votes), past polls