View Single Post
Old 01-30-2022, 07:13 AM   #7
Renate
Onyx-maniac
Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.Renate ought to be getting tired of karma fortunes by now.
 
Posts: 3,712
Karma: 16193287
Join Date: Feb 2012
Device: Nook NST, Glow2, 3, 4, '21, Kobo Aura2, Poke3, Poke5, Go6
Hmm, this is deep. I learned a bunch of things. Some even useful.

Ok, PDF has the "MediaBox". That tells you the number scale that everything is working on. If you say MediaBox[0 0 100 100] then PolyLine/Vertices[25 25 75 75] you'll get a diagonal line 1/2 the diagonal length of the "paper".

Ok, but what are the units? They are "points", 1/72 of an inch. Your paper is A5 (in the template). It should be (and is) MediaBox[0 0 419 596]. Your Air2 is issuing MediaBox[0 0 1404 1872]. 1404/72 = 19.5", 1872/72=26". 1404x1872 is the pixel count and Onyx is using that as paper size (in points).

So, just change the MediaBox, right? Erm, no. See attachment (which is A5 size). It's best viewed at 25% scale.

One solution: You can just use it as is, print to A5 paper using autoscaling.

You could write a utility to scale everything. Undoubtedly you can do this with Adobe "Manipulator" or whatever it's called.

The thing is, Your Air2 took your template and scaled it already. This could be fixed there in the code but it would take lots of fixing.

Best solution? Bitch to Onyx that they shouldn't be such knuckleheads as to put pixels in the MediaBox where points belong. Don't scale templates, use the MediaBox you find there.

Edit: You could fix it with "UserUnit" which changes that 1/72" to something else. If your template had a MediaBox[0 0 1404 1872] and a non-standard UserUnit to make it A5 size then this might work. Your template is PDF1.4, which doesn't support UserUnit.

Try some other template or reprocess the current template with Adobe "Manipulator" (or whatever) to see if you can put in a UserUnit.

OTOH, I just checked 94 random PDFs on my PC and none of them use UserUnit.

More edit: Well, I don't use the NeoReader and I couldn't even figure out how to annotate or export. For reference (mostly mine): TLDR: Neo always inserts screen size pages, there is no option.
Code:
com.onyx.android.sdk.neopdf.PdfUtils
   public static boolean pdfPageInsert()
      public static RectF getEmbeddedPdfPageRect()
         com.onyx.android.sdk.utils.ResManager;->getScreenWidth()
         com.onyx.android.sdk.utils.ResManager;->getScreenHeight()
If you hacked this to your 419, 596 I can almost guarantee that PDF properties would be A5. Except that I don't think anything would scale correctly without more hacking. I dunno. First I'd have to figure out how to scribble.
Attached Files
File Type: pdf a5-2.pdf (402.3 KB, 387 views)

Last edited by Renate; 01-30-2022 at 10:01 AM.
Renate is online now   Reply With Quote