Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Print media is no longer activated when rendering to PDF #14441

Closed
mafredri opened this issue Aug 1, 2016 · 4 comments
Closed

Print media is no longer activated when rendering to PDF #14441

mafredri opened this issue Aug 1, 2016 · 4 comments
Labels

Comments

@mafredri
Copy link

mafredri commented Aug 1, 2016

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version.

    2.2.2-development (6090f54)

  2. What steps will reproduce the problem?

    1. Install PhantomJS (6090f54)
    2. Open a page that utilizes @media print {}-css
    3. Save to PDF with page.render('out.pdf');
  3. Which operating system are you using?

    macOS 10.11.6

  4. Did you use binary PhantomJS or did you compile it from source?

    Source

  5. Please provide any additional information below.

    The print-media used to get applied prior to 7d7e5f3. Reverting the following two commits brings back the old behaviour:

    git revert bfccbd65f2855d38b9c8d826813315857b6379b0
    git revert 7d7e5f345b646ef18d23138781ae94197335b342

    I also reverted bfccbd6 because it seemed to continue on some of the changes introduced in 7d7e5f3.

@zowers
Copy link

zowers commented Aug 5, 2016

in issue #10623 people want the opposite, to always use media=screen

@mafredri
Copy link
Author

mafredri commented Aug 5, 2016

I can see a reason for both, to be honest. If this had not been a breaking change with regard to previous behavior, I probably wouldn't have reported it and relied on applying css classes for phantom "print emulation". Currently I have production systems relying on this behavior though :).

As exporting a webpage to PDF is usually done through a browsers print dialog, I think it makes sense to apply the print media by default. And I'm sure there are cases when you don't want it as well.

I haven't checked, but one concern about this change is e.g. how it affects pagination, etc. Especially with regards to 7d7e5f3#diff-e6d43d0460770360ad54e3b50f04734cL1204, e.g. how does QPrinter differ in behavior compared to QPageSize.

@GendelfLugansk
Copy link

Any workaround for this? I need to use print media

@stale stale bot added the stale label Dec 26, 2019
@stale
Copy link

stale bot commented Dec 29, 2019

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants