Printing feature problem: document rotation is not properly followed by comments position

Product: PDFTron WebViewer

Product Version: 8.3

Please give a brief summary of your issue:

Hi,

When I try to print a document with a larger width than height, it rotates it in 90 degrees automatically.
It could not be a big problem, but the big problem is that the comments (annotations) in the document just lose their respective position (because the size of the page is redesigned I think).
Basically, the new background which is simulated to fit the browser layout print in the modal absolutely doesn’t respect initial positions and distances between comments:

  • Inside the viewer, I let one comment in each border of the image (total of 4 yellow, as you can see):

  • Within the Chrome print modal (it’s a bit better with Edge but not perfect) the document rotates (to fit the standard page format which is generated like A4…, BUT it redeploys annotations in some strange positions which are not correct):

How can we handle that, please?
The objective is to save the exact position related to the artwork (with or without rotation, and with and without adding borders to fit the standard format page).

Thanks in advance for your help,

Alex

Hi Alex.
Thanks for contacting PDFTron Support. I am Jack in WebViewer team to support you.
I tried to reproduce your issue in JavaScript PDF Viewer Demo. However, I cannot make it. Could you help me to double check the issue? If yes, could you send me your document for me to do the test? Thanks

Jack

Hi @jhou

Here are the detailed steps:

  1. select a new document with the following size: x*y => x>y

  2. annotate it (here I let 3 comments in very specific areas like borders)

  3. Print and the image proceed a 90° rotation (and I can’t change that) + annotations are not exactly at the same place (they lose some mm of height) + the quality is not that good

Here is the document I used:

Thank you in advance for your time.

Hi Alex
I can see what you mean here. We disable the StickyAnntoation’s rotation and zoom property so that when you doing the rotation like this, it won’t rotate with the document. Here is the solution for you if you want to rotate the StickyAnnotation:

const {Core: {annotationManager, Annotations}} = instance;
const stickyAnnots = annotationManager.getAnnotationsList().filter(annot => annot instanceof Annotations.StickyAnnotation);
stickyAnnot.forEach(annot => {
    annot.NoRotate = false;
    annot.NoZoom = false
})

You could disable all Sticky Annotation By setting the NoRotate and ‘NoZoom’ value false

Best
Jack

Hi @jhou

Thanks.

Could you please confirm me that this code will only fix the issue when printing? Because it is perfectly when the document is not in the print modal but in the viewer (the rotation applies at the same time for both annotations and artwork, without size changes or something that would make it not correct).

Is there a command to disable the rotation of the document too, because I’m afraid that it will keep the annotation at the right place, but the document will rotate anyway so it will possibly not be accurate too, right?

Thanks in advance for your help.

Best Regards,

Alexandre

Hi Alex
Currently, we don’t have any option for disable page auto rotate in the print. If we enable the Rotation and Zoom for the StickyAnnotation, it will have the same location in the document.

Best
Jack

Hi Alexandre,

We have an API to some default print options (See documentation here).

In order to maintain the document orientation on printing you can called it like this

instance.UI.setDefaultPrintOptions({ maintainPageOrientation: true});

Please let us know if this helps you.

Best regards,
Dandara Navarro