TheAxeDude / ZiniGo

Utility to backup magazines from the Zinio service as PDF, bypassing/Removing their DRM.
MIT License
51 stars 9 forks source link

Pdfs are zoomed in too close #6

Closed armyofskankz closed 3 years ago

armyofskankz commented 3 years ago

I am able to run the program, get the pages, and have a full issue of a magazine created in pdf. However, each page shows only the upper left corner of the magazine page - in other words, it is zoomed in too much on the corner.

TheAxeDude commented 3 years ago

Hi, thanks for the feedback. Are you using the version in the master branch, or the feature/testing-api-changes branch?

https://github.com/TheAxeDude/ZiniGo/tree/feature/testing-api-changes/built

On Wed, 9 Dec 2020, 19:56 armyofskankz, notifications@github.com wrote:

I am able to run the program, get the pages, and have a full issue of a magazine created in pdf. However, each page shows only the upper left corner of the magazine page - in other words, it is zoomed in too much on the corner.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/TheAxeDude/ZiniGo/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEL5USSDGODUZBWBDPI3M3ST624LANCNFSM4UT3A3JA .

armyofskankz commented 3 years ago

Testing API version

armyofskankz commented 3 years ago

Games World of Puzzles - September 2020.pdf

TheAxeDude commented 3 years ago

Ok cool, I'll take a look and let you know!

On Wed, 9 Dec 2020, 21:21 armyofskankz, notifications@github.com wrote:

Games World of Puzzles - September 2020.pdf https://github.com/TheAxeDude/ZiniGo/files/5668161/Games.World.of.Puzzles.-.September.2020.pdf

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/TheAxeDude/ZiniGo/issues/6#issuecomment-741992910, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEL5UXU6NMG7PVPLFIJOADST7E35ANCNFSM4UT3A3JA .

TheAxeDude commented 3 years ago

Hi,

Did a quick test - it seems the "default" template is causing this. For now, please just download template.html (https://raw.githubusercontent.com/TheAxeDude/ZiniGo/feature/testing-api-changes/built/template.html) and put it in the same folder as your executable.

I'll push a fix for this soon.

TheAxeDude commented 3 years ago

Hi, new version has been released (on master). Please let me know if it works

kiloxxx commented 3 years ago

Hi TheAxeDude, great work!

I am testing the new linux version and the zoom is still too close: any single page is horizontally cropped and vertically splitted in two pages 464550_19.pdf.

There is also a minor issue, when you run the script for the first time the "issue" folder is created, but the owner has not any read and write permissions, so the script stops with an error.

TheAxeDude commented 3 years ago

Thanks for the feedback - admittedly, I had just hoped the linux version would work, without testing it. I will try it out asap, and let you know when it is sorted.

BlackB846 commented 3 years ago

Hi,

I have the same issue but I found a work-around.

I download the first page and stop the further processing. I then open the generated html file and inspect the properties / source of the referenced image which will give me the exact size of the image.

I then go into the template.html file and insert the correct size in the two @page tags in pixel.

After restarting the download process, all PDFs are perfect and the final file will not have the zoomed problem anymore.

I guess the dynamic function to size the page that is embedded in the template doesn't work correctly.

BlackB846 commented 3 years ago

One more observation - when setting the page size correctly, the PDF will show two symbols at the bottom which don't exist in the image. The PDF contains the two characters " and > which look like they are additional characters in the HTML file after the end of document.

I'm not too familiar with HTML documents but if I look at the template with the injected image reference, these two exact characters follow after the tag before the tag.

I could imagine they don't belong there and they prevent the fixpage() function that is defined after the tag to be executed correctly. Due to that, the size of the page is never adjusted to the size of the image which would explain the "zoomed" version with some of the files.

BlackB846 commented 3 years ago

Hi @TheAxeDude

I changed two minor things in the template.html which seems to solve the problem for me:

I removed the "> after the SVG_PATH place holder. You seem to insert the "> with the image reference which duplicates those two elements.

I changed the java script for fixpage which adjust the page size from: pageCss = @page { size: \${renderBlockInfo.width} \${fixHeight} ; margin:0;} to: pageCss = "@page { size: " + renderBlockInfo.width + " " + fixHeight +" ; margin:0;}"

The variables don't seem to be replaced and therefore the page size setting is not adjusted.

kiloxxx commented 3 years ago

Hi, the change to template.html suggested by @BlackB846 worked for me, now the zoom level is correct!

I changed the java script for fixpage which adjust the page size from: pageCss = @page { size: \${renderBlockInfo.width} \${fixHeight} ; margin:0;} to: pageCss = "@page { size: " + renderBlockInfo.width + " " + fixHeight +" ; margin:0;}"

TheAxeDude commented 3 years ago

Thanks a lot for experimenting with this, @BlackB846 & @kiloxxx ! I'll add the changes you suggested to the default template file.

BlackB846 commented 3 years ago

All of my magazines work with the modified template.

armyofskankz commented 3 years ago

The latest version worked for me without issues. Thanks