rschroll / rmrl

Render reMarkable documents to PDF
GNU General Public License v3.0
119 stars 21 forks source link

Look for base page dimensions in parent of parent in merge_pages #9

Open ttrine opened 3 years ago

ttrine commented 3 years ago

Hi rschroll,

I'm using your library in my project and it's very useful, thanks!

This PR fixes a small issue I encountered when running this library on a few of my PDFs. I can tell by your existing comments that finding the base page dimensions is a bit of a pain point. I was able to resolve a majority of error cases I was seeing by looking for the dimensions in the parent of the parent if necessary.

If it still can't find them, I throw an exception that describes what's going on, to avoid the less-than-helpful "'NoneType' object is not iterable" that it's throwing currently.