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

each text character is rendered as a separate element #111

Open
acthp opened this issue Feb 10, 2020 · 1 comment
Open

each text character is rendered as a separate element #111

acthp opened this issue Feb 10, 2020 · 1 comment
Labels

Comments

@acthp
Copy link

acthp commented Feb 10, 2020

Users that wish to modify and refine the generated pdf with a pdf editing tool report that every character in the pdf is rendered as a separate element. So it's not possible for them to change the text color, content, font size, etc., without individually editing each character.

It does appear from the code that every glyph is positioned and rendered individually. I expect this reflects some difficulty in translating between svg and pdf, but it would be more useful to end users if there were a way to preserve the full strings of the svg in the pdf.

@alafr
Copy link
Owner

alafr commented Feb 22, 2020

I confirm this. It happens here https://github.com/alafr/SVG-to-PDFKit/blob/master/source.js#L2136

Can you check if text generated by PDFKit (like this one: http://pdfkit.org/demo/out.pdf) can be edited without issues?

If so, the SVG-to-PDFKit code should check for each character if it has only moved in the x direction from the previous one, and is such cases use the same code as in PDFKit.

I don't have time to fix it myself, but you can submit a pull request.

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

No branches or pull requests

2 participants