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

Feature request: render pdf from page #2646

Open
leotsarev opened this issue Sep 20, 2024 · 5 comments
Open

Feature request: render pdf from page #2646

leotsarev opened this issue Sep 20, 2024 · 5 comments

Comments

@leotsarev
Copy link
Contributor

Feature request

Environment

Zola version: 0.19.х

Expected Behavior

I want zola to be able to create PDF from any page. Use case that I create site with documentation, and I want user to be able to download PDF for some of pages, and me to be able to control PDF content.

I envision use case like this:

  1. There is create_pdf parameter for any page/section
  2. If "yes", zola should render given page twice - as a HTML, and as a PDF (create pagename.pdf near page/index.html)
  3. Basically, rendering PDF should be creating temporary HTML and passing it to something like wkhtmltopdf with corresponding css
  4. Zola should pass page.rendering_as_pdf parameter to templates, enabling user to add/remove content based on this parameter
  5. Zola should allow pages to reference "this" PDF by relatrive url syntax (@pagename.pdf)
  6. May be Zola should automatically create PDFs, it they are referenced by relative url and doesn't exists in static folder
  7. May be there is should be option to create PDF from section (including all pages)
@ARitz-Cracker
Copy link

ARitz-Cracker commented Sep 23, 2024

Unsure if this is within Zola's scope and kinda sounds like an XY problem. Any particular reason why you don't want to use these?

@Keats
Copy link
Collaborator

Keats commented Sep 24, 2024

That would be my go-to approach as well. Stuff like wkhtmltopdf are IMO not good enough so you need to have some headless browser if you want good results

@leotsarev
Copy link
Contributor Author

Any particular reason why you don't want to use these?

I miss opportunity to render different content "for print/pdf" and "for html". One example would be to include subpages into content.

@jamiedumont
Copy link

Any particular reason why you don't want to use these?

I miss opportunity to render different content "for print/pdf" and "for html". One example would be to include subpages into content.

If you’re after included sub-pages, are on macOS or Windows and aren’t adverse to paid software, the iA Writer does a wonderful job of turning markdown into pdfs.

@leotsarev
Copy link
Contributor Author

I don't like idea of having different pipelines....

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

4 participants