utils.downloadPage PDF size issue - request method to generate PDF of app under set display dimensions

I have been playing with this feature, and was able to scope the export to a single container component, and that is good. The problem is, when I export on my monitor, I get a nice, wide PDF. When my co-worker tries with a smaller screen, they get a much skinnier PDF.

I tried fullscreen and scale but can't seem to get deterministic PDF generation.

Hey @khill-fbmc At the moment Retool doesn't provide a method to generate a PDF of an app under set display dimensions, but I have created a feature request for this on your behalf! I'll tag you here if Retool ships this update at some future point.

1 Like

Hi @khill-fbmc,

The utils.downloadPage function doesn't render a PDF based on your screen size. The PDF is rendered based on the content of the page you are exporting. If your coworker gets a skinnier PDF, it is likely that their page has less content on it than yours.

One way to ensure that you and your coworker get the same PDF is to use the --window-size flag when generating the PDF. This flag allows you to specify the width and height of the window that is used to render the PDF. For example, you could use the following command to generate a PDF that is 1000px wide and 800px high:

utils.downloadPage --window-size 1000,800

Hope this helps.

:grinning:

Patrick

1 Like

Hey @PatrickMast I don't think the information you've shared is correct.

The command you shared isn't valid JS and doesn't align with the syntax of the utils.downloadPage method - utils methods | Retool Docs

Can you share any references to documentation or a recording of how you're achieving this within Retool that backs up this information?

Hi @PatrickMast , I can't seem to get this to work. Could you share an example of where you've gotten this to work? The syntax you provided is not recognised, I have attemped other syntaxes that are recognised but just simply do not "read"

Any update on this yet?
We are using the downloadAsPDf but the resolution/size cannot be controlled at all. WE have to advise our users to use another tool to get the created pdf correct and it's not a good Ux

@peter.b unfortunately no updates yet :smiling_face_with_tear:

Better PDF integration is on our road map and the eng team is working on a major overhaul to get a bunch of PDF supporting features and components up and running.

I will add your plus 1 to the ticket and post any updates here!

Any word on better PDFintegration. I am trying to make animal cage cards and need a consistent way to send data to print on a 3x5 index card

Hi @Gillian_Durham,

Unfortunately no news on a timeline for greater PDF controls.

I would say that for your use case of printing out PDFs, use utils.downloadPage() with the PDF component taking up a full page of a multipage app.

Then once you have the PDF downloaded, you would just need to manually trigger the printing and use you computer's printer sizing :sweat_smile: