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

Minor glyphs positioning issue #41

Closed
sergvdm opened this issue Jan 13, 2025 · 3 comments
Closed

Minor glyphs positioning issue #41

sergvdm opened this issue Jan 13, 2025 · 3 comments

Comments

@sergvdm
Copy link

sergvdm commented Jan 13, 2025

For some PDFs library produces slightly incorrect positioning of particular glyphs:
PDF1:
pdf1
SVG1:
svg1

PDF2:
pdf2
SVG2:
svg2

pdf1.pdf
pdf2.pdf

@dmester
Copy link
Owner

dmester commented Jan 13, 2025

Thanks for reporting this issue.

pdf1.pdf

Regarding the unaligned letters, I get the same result in Adobe Reader (first image) and Firefox (second image) at some resolutions. This is likely rounding errors due to transformations applied on individual letters in the headers.

issue-41-adobereader
issue-41-firefox

Regarding the space before the ending "n", I can't reproduce this in PdfToSvg.

issue-41-pdftosvg

Questions:

  • Are you using the latest version of PdfToSvg?
  • Which SVG viewer do you use?
  • Are you using any non-default options in the calls to ToSvgString or SaveAsSvg?
  • Is there some post processing on the SVG?

pdf2.pdf

This seems to be caused by a font creation date that was outside the expected range. This will be fixed in version 1.6.0.

@sergvdm
Copy link
Author

sergvdm commented Jan 14, 2025

Are you using the latest version of PdfToSvg?
Yes, the latest sources from master branch

Which SVG viewer do you use?
Edge or Chrome browser and WPS Office pdf viewer/editor - both produces same render (at least I don't remember any difference)

Are you using any non-default options in the calls to ToSvgString or SaveAsSvg?
Yes, my bad, sorry. I completely forgot, I added some options in my software half year ago:) Reported result was produced with

            var svgConversionOptions = new SvgConversionOptions()
            {
                CollapseSpaceEmbeddedFont = 0.2,
                FontResolver = FontResolver.EmbedWoff,
            };

Default options gives correct result.

Is there some post processing on the SVG?
No.

@dmester
Copy link
Owner

dmester commented Jan 18, 2025

Thanks for the followup. The problem in PDF2 should now be fixed in version 1.6.0.

@dmester dmester closed this as completed Jan 18, 2025
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