Coder Social home page Coder Social logo

Comments (5)

maltoe avatar maltoe commented on August 18, 2024 2

Released as v1.17

from chromic_pdf.

maltoe avatar maltoe commented on August 18, 2024 1

@RodolfoSilva I've pushed a PR that allows to more easily run custom protocols - something I've been wanting to do for a while. A custom protocol would allow you to execute whatever devtools commands you want before the actual PDF printing. I've included an example for your use-case in the tests ☝️. As stated in the PR description, I'd consider the Protocol behaviour & the macros still to be internal API, but it's unlikely they're going to change anytime soon.

Still open for a :device_metrics_override option if you're willing to work on that instead, though.

from chromic_pdf.

RodolfoSilva avatar RodolfoSilva commented on August 18, 2024 1

Thanks @maltoe, this solves my issue

from chromic_pdf.

RodolfoSilva avatar RodolfoSilva commented on August 18, 2024

Right now, the workaround I've found is to set a global window size with:

chrome_args: "--window-size=375,375"

I was wondering if there is a better way to achieve this result without setting a global value.
@maltoe do you have any suggestion?

from chromic_pdf.

maltoe avatar maltoe commented on August 18, 2024

Hi @RodolfoSilva,

no, there's no option to set the screen size per job. The full_page option comes close, setting the screen size to the content size, see here. If you'd like to give it a try, you could start from there. Option could be something like {:device_metrics_override, [width: ..., height: ...]}.

from chromic_pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.