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

DrawingUtil#drawRectangle calls closePath() when path already got closed by preceding fill() #85

Closed
msww opened this issue Apr 20, 2020 · 2 comments

Comments

@msww
Copy link

msww commented Apr 20, 2020

Hi - I'm trying out easytable for a project, and am finding that some PDF processors (e.g. pdftotext from Poppler 0.48.0) spit out large numbers of messages like Syntax Error: No current point in closepath on documents I create using easytable.

It looks like the cause is that DrawingUtil#drawRectangle calls closePath() (which maps to PDF content stream operator h) as part of drawing the rectangle. However, this happens after it has already called fill(), which is implemented as PDF's operator f.
According to the PDF Specification PDF 32000-1:2008 section 8.5.3.3.1, the f operator already closes any open subpaths, leaving no open path that could be closed.

I think the call to closePath() is redundant. Removing the line results in a PDF file that does not cause those error messages without any obvious change to the rendering of the table.

@vandeseer
Copy link
Owner

Hey @msww , thanks a lot for your thorough analysis!

I never experienced any issue like the one you are mentioning but your comment makes perfect sense. I will hence remove the respective line (as soon as I find time and if there are no other issues popping up due to removing the line).

Thanks again!

Best,
Stefan

vandeseer pushed a commit that referenced this issue Apr 22, 2020
@vandeseer
Copy link
Owner

Removed the respective line in version 0.6.5. If you find anything else, let me know!

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