Closed Bug 1282045 Opened 8 years ago Closed 2 years ago

print pdf with both orientations

Categories

(Firefox :: PDF Viewer, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 844090
Tracking Status
firefox68 --- affected
firefox69 --- affected
firefox70 --- affected
firefox86 --- affected

People

(Reporter: grinkovv, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: testcase, Whiteboard: [print2020][pdfjs-printing] )

Attachments

(3 files)

Attached file Тест 1.pdf
User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36

Steps to reproduce:

I whant to print a pdf file which has two orientations in one file (portant and landscape)


Actual results:

print all pages in portant. in chrome all ok


Expected results:

first two pages in portant, third in landscape
Component: Untriaged → PDF Viewer
Whiteboard: [pdfjs-c-integration][pdfjs-d-printing]
Source PDF file with one portrait-oriented page and one landscape-oriented page
Result of printing Source.pdf file using PDFjs
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Priority: -- → P3
Version: 49 Branch → unspecified

There is a preference for this, but it defaults to false. Is there any reason not to switch the default to true?

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.

(2) In the search box above the list, type or paste PDFJS and pause while the list is filtered

(3) Double-click the pdfjs.enablePrintAutoRotate preference to switch the value from false to true, then test again

(In reply to jscher2000 from comment #3)

(3) Double-click the pdfjs.enablePrintAutoRotate preference to switch the value from false to true, then test again

It doesn't work. See Bug 1406098

(In reply to Jason from comment #4)

(In reply to jscher2000 from comment #3)

(3) Double-click the pdfjs.enablePrintAutoRotate preference to switch the value from false to true, then test again

It doesn't work. See Bug 1406098

Bug 1406098 is a problem with Firefox not auto-detecting the orientation of the first page of PDF and changing the print output to match. For example, if the first page of the PDF is landscape but the last saved orientation for the current printer was portrait, Firefox prints portrait and shrinks to fit.

The auto-rotate feature in pdf.js changes the orientation of the second and subsequent pages to the same as the first, so the use case in this bug (portrait, landscape) should be handled -- as long as the last saved orientation for the current printer is the same as the orientation of the first page of the PDF.

Hi I'm interested in fixing this bug, but as I am fairly new to developing for Firefox, can someone give me some guidance please?

I have examined the following two files:
https://github.com/mozilla/pdf.js/blob/master/web/pdf_print_service.js
https://github.com/mozilla/pdf.js/blob/master/web/pdf_page_view.js

I am able to acquire the width and height of each page in the PDF file with the "setPdfPage" method in "pdf_page_view.js" and the "renderPage" method in "pdf_print_service.js". And I can check if the page is in portrait or horizontal orientation with these information.

But I'm not sure how I can utilize this to make the rendered pages for printing not be in the same orientation

Blocks: 1615910
Whiteboard: [pdfjs-c-integration][pdfjs-d-printing] → [print2020]

After implementing a PDF printing functionality in an extranet, we will have to migrate a complete team from Firefox/86.0 to Chrome if this one isn't fixed.

The temporary solution to change "pdfjs.enablePrintAutoRotate" to "true" via "about:config" is working for us (https://github.com/mozilla/pdf.js/issues/6696#issuecomment-639371525).

Can changing the default value from "false" to "true" could be the solution to this bug?

(In reply to Benjamin Mucci from comment #8)

The temporary solution to change "pdfjs.enablePrintAutoRotate" to "true" via "about:config" is working for us (https://github.com/mozilla/pdf.js/issues/6696#issuecomment-639371525).

You also can push that out via Group Policy in Firefox ESR 78.6 or later, or Firefox 84 or later:

Can changing the default value from "false" to "true" could be the solution to this bug?

I think so, but who am I?

bug 1406098 says that pref doesn't work?

(In reply to Mike Kaply [:mkaply] from comment #10)

bug 1406098 says that pref doesn't work?

I just tested this again with ESR 78 and pdfjs.enablePrintAutoRotate set to true. When printing the landscape PDF attached to that bug, it still prints portrait. I also tried a second computer with none of my settings. I tried both a physical printer and the virtual Microsoft Print to PDF.

Doing the same with Edge, the it prints landscape, so the attached PDF seems like a valid test.

(In reply to Mike Kaply [:mkaply] from comment #10)

bug 1406098 says that pref doesn't work?

The preference controls whether pages after the first page are rotated. Say your PDF is portrait, portrait, landscape. If the preference is enabled, the third page will be rotated.

The preference does NOT detect/set proper orientation for page 1. That is other bug.

The preference controls whether pages after the first page are rotated. Say your PDF is portrait, portrait, landscape. If the preference is enabled, the third page will be rotated.

I wonder why the first page isn't considered? (comment 11)

Whiteboard: [print2020] → [print2020][pdfjs-c-printing]
See Also: → 844090
Whiteboard: [print2020][pdfjs-c-printing] → [print2020][pdfjs-printing]
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: