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 · 10 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 (e.fraga@ucl.ac.uk) 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.

@SNeugber
Copy link

SNeugber commented Feb 4, 2025

Hi @ericsfraga I'm currently trying to do something similar I think in order to merge the annotations/drawings on top of imported PDFs. Did you ever get this working?

@Seb-sti1
Copy link
Contributor

Seb-sti1 commented Feb 4, 2025

Hey @SNeugber, To my knowledge there are two packages that use rmc and align the strokes on top of the PDF.

PS: there are probably other implementations not based on rmc/rmscene, but I wouldn't be able to help regarding those
PPS (for ricklupton): if i'm not mistaken the initial issue should have been fix by #19

@SNeugber
Copy link

SNeugber commented Feb 5, 2025

Amazing, thanks. I'll look into those!

@ericsfraga
Copy link
Author

Hi @ericsfraga I'm currently trying to do something similar I think in order to merge the annotations/drawings on top of imported PDFs. Did you ever get this working?

I cannot remember. I actually gave up on this and started using the reMarkable software instead. I don't use the tablet as much as I used to and the standard tools do the job I need now.

@SNeugber
Copy link

SNeugber commented Feb 6, 2025

Hey @SNeugber, To my knowledge there are two packages that use rmc and align the strokes on top of the PDF.

* [rmtree](https://github.com/Seb-sti1/rmtree) (this is my implementation): it aims at exporting the whole rm files as a folder tree

* [remarks fork of Azeirah](https://github.com/Azeirah/remarks) (also see [Problems with coordinates Azeirah/remarks#5 (comment)](https://github.com/Azeirah/remarks/issues/5#issuecomment-2585482443) about an explanation of the alignment of strokes with the background pdf)

PS: there are probably other implementations not based on rmc/rmscene, but I wouldn't be able to help regarding those PPS (for ricklupton): if i'm not mistaken the initial issue should have been fix by #19

Hm I tried that implementation, but even after adjusting the hardcoded screen dimensions for my paper pro I guess I'm trying to do "unsupported things", and it's just not rendering correctly. Is there already any work in progress on that I could contribute to btw? Could at least open a new issue for it?

@Azeirah
Copy link
Contributor

Azeirah commented Feb 6, 2025

Hey @SNeugber, To my knowledge there are two packages that use rmc and align the strokes on top of the PDF.

* [rmtree](https://github.com/Seb-sti1/rmtree) (this is my implementation): it aims at exporting the whole rm files as a folder tree

* [remarks fork of Azeirah](https://github.com/Azeirah/remarks) (also see [Problems with coordinates Azeirah/remarks#5 (comment)](https://github.com/Azeirah/remarks/issues/5#issuecomment-2585482443) about an explanation of the alignment of strokes with the background pdf)

PS: there are probably other implementations not based on rmc/rmscene, but I wouldn't be able to help regarding those PPS (for ricklupton): if i'm not mistaken the initial issue should have been fix by #19

Hm I tried that implementation, but even after adjusting the hardcoded screen dimensions for my paper pro I guess I'm trying to do "unsupported things", and it's just not rendering correctly. Is there already any work in progress on that I could contribute to btw? Could at least open a new issue for it?

Hi! I'm working a lot on remarks. Remarks is just rmc underneath for the most part. I aim to get output with remarks that is on par with the official exporter, it's because remarks powers the sync for https://scrybble.ink

I'm going on a three week holiday, so not going to be able to work on this the coming few weeks, but would love to pick this up afterwards.

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

5 participants