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

Page is cropped vertically when converting, losing the bottom third of the page #8

Open
ericsfraga opened this issue Sep 26, 2023 · 4 comments

Comments

@ericsfraga
Copy link

ericsfraga commented Sep 26, 2023

I have an .rm file which is a set of annotations on a PDF file that I uploaded to the tablet. When I convert the rm file using rmc (installed with pipx rmc), the resulting image in PDF is cropped vertically, containing only the top two thirds (guesstimate) of the page. The SVG version, however, does have all the content.

I think this has something to do with the width and height being larger than a standard A4 page (say) so maybe it's really a problem with the tools that display PDF documents... If so, apologies for the noise.

I'm happy to provide the .rm file if you wish as well as the original (1 page) PDF and the PDF that the tablet generates with the annotations.

@ericsfraga
Copy link
Author

I've been playing around with your code. For the document in question, the y dimension is strange. If I turn debugging on, I get this output at the start:

xmin: -681.7701416015625 xmax: 927.3253784179688 ymin: 1231.4434814453125 ymax: 2448.491943359375
height: 1872 width: 1610 xpos_delta: 702.0 ypos_delta: 0

so because the difference between ymax and ymin is less than the screen height, the screen height is used as the height. Just thinking out loud here...

@ricklupton
Copy link
Owner

Thanks for reporting! Yes sharing the files would be helpful.

@ricklupton
Copy link
Owner

Getting the coordinate origin right is a bit tricky with the different resolutions, page sizes, text anchors, etc, so if it’s a nonstandard page size maybe the code doesn’t account for that properly at the moment.

@ericsfraga
Copy link
Author

I cannot attach the .rm file. Please email me ([email protected]) and I will send the PDF and the .rm file directly, if you wish.

I've been playing quite a bit with your code, adding the capability to scale the vector drawing of the rm file to fit the original PDF. I'm cleaning up my additions to the code and generalising it for this purpose and will share when done.

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