I have a doctype which stores passes for Events and want attendees to be able to download passes in PDF format. I’ve designed a script report and custom print format for the same.
I want to make a website page, where attendee can enter two fields (for authentication) and hit submit to download his PDF.
How can we make a request to server with report parameters to directly get pdf as response? Are there any alternate ways to get the pdf?
The URL to generate a PDF for any doc in Frappe/ERPNext is:
Where you can specify the doctype, name and the print format name to generate it’s PDF.
I’ll try both options and revert back which one worked for me.
I went partly with suggestion of @netchampfaris.
It seems to be working good so far.
- Create a website page
- Create a whitelisted method with (allow_guest=True)
- copied some lines of code which were written to generate pdf in frappe.utils.print_format.download_pdf with some additional logic to log this activity.
- Allowed Doc Permissions for Guest User
If i run this in backend (php) will downloaded file be downloaded in backend?