This example uses the PDF Generator API as a tool to create a PDF template that will be used by your site to create a PDF document from site data. To get started, do the following:
From the Wix Package Manager in the Editor, install the pdf-generator-api NPM library.
Refresh the templates page to see your new pdf template.
Copy the template’s ID to the ID field in the code in the pdfGenerator.jsw file.
Publish your site.
The link returned from the call to the API is an external link. Since wix-location.to() only works for external links on a published site, you will need to publish your site to see the generated PDF.
Thanks for the link fix.
I’m still having trouble where do I put the API I got from PDF?
And another small question, if possible, now that I see the code on an edit site, if I have a complex page am I supposed to compile all the parameters? Isn’t there a button that finds the entire page like a screenshot? Because I have squares and the like.
Thank you for all the helpful help and posts. Worth Parag
Hİ @yisrael-wix I have followed tutorial and checked all details on the sample page at the editor and publised but it is not working and gives error as it shown below;
(node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Did you get any this kind of error before?
I have seen also another issue but ı understand it is fine because it gives same error on your sample page at the editor site as it shown below;
The errors you are getting are from the NPM library. I would say that they’re OK, however errors are never OK. Let’s just say it’s beyond our control and it works.
@yisrael-wix Thank you very much for your answer. I’ve tried everything and even edited your own sample with my information got it but it still doesn’t work. Do you think am ı missing something on backend code
Hi @yisrael-wix It is working now thank you so much for your support and exact backend code below;
import PDFGeneratorAPI from ‘pdf-generator-api’
const apiKey = ‘API KEY’;
const apiSecret = ‘API SECRET’;
const baseUrl = ‘https://us1.pdfgeneratorapi.com/api/v3/’;
const workspace = ’ your e-mail address used on pdf generator api to creat an account’;
const templateID = ‘Templete Id’;
let Client = new PDFGeneratorAPI(apiKey, apiSecret)
Client.setBaseUrl(baseUrl)
Client.setWorkspace(workspace)