Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Width and Height as JSON Inputs for PDF Export #8

Open
nelsontr opened this issue Oct 28, 2024 · 0 comments
Open

Add Width and Height as JSON Inputs for PDF Export #8

nelsontr opened this issue Oct 28, 2024 · 0 comments

Comments

@nelsontr
Copy link

Hey @arthur-mdn! Great repository—really helpful!

Would you be able to add some modifications to enable exporting multiple PDFs with varying aspect ratios?

One approach could be adding width and height fields as parameters in the curl request to the service. This would ensure more consistent PDF customization across different Grafana versions, allowing for identical PDF output regardless of the Grafana version in use.

In our case, we have multiple dashboards developed by different team members, each with unique aspect ratios. These settings would be invaluable for exporting accurate, tailored reports across our diverse dashboard collection.
Here’s an example of how it might look:

curl \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{ 
    "url": "http://your-grafana-server/d/your-dashboard-id?orgId=1&kiosk",
    "width": "1200px",
    "height": "4000px"
  }' \
  http://localhost:3001/generate-pdf

Adding these parameters would likely override the autoHeight feature in the script, making it more versatile for different aspect ratios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant