react icon indicating copy to clipboard operation
react copied to clipboard

Example of PDF FormBuilder

Open Anandks1993 opened this issue 5 years ago • 3 comments

Hi,

I am going to tryout the PDF FormBuilder mode and right now when I try to upload a PDF it uses https://api.form.io/upload API to upload the file. Is there a way to modify this like FileService for file component?

Note: I tried setting projectUrl in the options but it appends the /upload text at the back in the API, also need to add headers for authentication.

Thank you for this wonderful package and thank you in advance.

Anandks1993 avatar Jan 18 '21 08:01 Anandks1993

You can modify where this goes by altering the following code.

https://github.com/formio/formio.js/blob/master/src/PDFBuilder.js#L221

You can then just send this file whereever you want.

// This is how you override the upload method in the pdf builder.
Formio.Builders.builders.pdf.prototype.upload = function(file) {

};

travist avatar Jan 18 '21 14:01 travist

@travist Thank you very much for quick response. I will check out this.

Anandks1993 avatar Jan 18 '21 15:01 Anandks1993

Hi @travist as you suggested I could upload PDF to custom server and convert it to HTML like formio does. But when I try to render the generated html document the components inside the sidebar is disabled, I could not drag and drop over the html pdf file. Am I missing something here which makes the buttons to go disabled?

Thank you in advance.

Anandks1993 avatar Mar 04 '22 07:03 Anandks1993

We're currently addressing a backlog of GitHub issues. Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!

jeriah-formio avatar Feb 14 '24 14:02 jeriah-formio