Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ÿþ" (BOM?) in Bookmarks #102

Open
jakejohns opened this issue Nov 5, 2015 · 2 comments
Open

"ÿþ" (BOM?) in Bookmarks #102

jakejohns opened this issue Nov 5, 2015 · 2 comments

Comments

@jakejohns
Copy link

I don't seem to be able to get bookmarks to work correctly.
I see #26 references encoding issues with bookmarks, but I'm not positive this
is related.

$facade = PHPPdf\Core\FacadeBuilder::create()->build();

$doc = '<pdf><page><div bookmark="aaa">A</div>
    <div bookmark="bbb">B</div></page></pdf>';

$content = $facade->render($doc);

file_put_contents('./out.pdf', $content);

results in the following bookmarks:

ÿþa
ÿþb

And what I believe are the relevant lines in the PDF:

8 0 obj 
<</Title (ÿþa
@aledeg
Copy link
Contributor

aledeg commented Mar 6, 2016

I can fix that behavior by changing the encoding used for rendering with the following patch. But I don't know if it's a good idea or not.
I don't know if there is a need to encode in UTF-16.

Ping @psliwa

encoding.txt

@aledeg
Copy link
Contributor

aledeg commented Mar 6, 2016

Doing what I've done in the patch breaks other things like accentuated characters like é or ë. So that's not a good idea !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants