How to download the filled version of a pdf?

Hi,

I used to use DocumentServer 7.5 to create docxf form, for my users, and save it as oform when the form is filled by the user.
I’m trying to upgrade to DocumentServer 8.1, and I have a problem with fillable pdf.

I manage to switch my docxf to pdf, so that the user can create the form in pdf format.

Then, when it’s time to fill the pdf, I manage to open it with fillform mode. The user can now fill the pdf, and click on submit button. This action correctly call by callbackhandler.

In the handler, I have 2 information :

  • the url of the pdf (not filled)
  • the url of the json containing information user fill.

But is there a way to get back the pdf filled by the user ? How can I download it ?

Thanks

1 Like

I have the same problem, i comment to follow the post

I have resolved this toggle the autosave on true on the customization object. So the problem is that onlyoffice is showing us the latest version that it has . With the auto save option enabled when the user enter the value in the form the doc is saved on the document server and when the user push the complete botton the custom callback handler will retrieve the doc with the form filled.

Hello
I still have the same problem with adding autosave=true in customization : when the callback handler is called, I have only the empty PDF (without fields filled).

Did you have the “forcesave” on true?

Yes, I set both autosave and forcesave to true, but same behaviour

Try to put forcesave on false and save on false with the autosave on true, my customization is like this. Remember that the mode has to be “edit” and not “view”.

In fact, I dont want to use the mode “edit”, but the mode “fillform” :slight_smile:

Dear @rdenarie, I noticed that you contacted colleagues of mine via Zendesk and they have replied to you already. Please check out your Zendesk ticket.
Dear @Ghug, thank you for the help!

Hi,

Did you ever solve this issue? I have a PDF Form filler, and the Submit button is visible. How do I handle the user pressing this button?

I’m using 8.3.3 of Documentserver.

The documentation for form filling doesn’t close the loop or I’m missing it.

Regards

Hello @hanland

I have replied to you in this topic in regard of this question:

Hi,

This is my code. When I hit the submit button, I just get the saving icon going round. If I remove the callbackurl I just get submit failed. Any suggestions?


    function onSubmit(event) {
        console.log("The form was submitted.")
    }

    useEffect(() => {
        const documentUrl = 'https://chiralcloud.fra1.digitaloceanspaces.com/group1/3/uploads/7344303.pdf';
        const submitUrl = 'https://chiralhome.hopto.org/fYHe4FPLm44mXEhs/Patients/uploadFiles';

        // Initialize ONLYOFFICE DocumentServer editor
        const docEditor = new window.DocsAPI.DocEditor('placeholder', {
            document: {
                fileType: "pdf",
                permissions: {
                    edit: false,
                    fillForms: true

                },
                title: "Form",
                url: documentUrl,
                isForm: true,
            },
            documentType: "pdf",
            editorConfig: {
                callbackUrl: submitUrl,
                customization: {
                    autosave: false,
                    submitForm: true, // Show Submit button
                    forcesave: true,
                },
                user: {
                    id: 'pdf-form-user',
                    name: 'PDF Form User'
                },
            },
            events: {
                onSubmit,
            }
        });

        // Cleanup on component unmount
        return () => {
            if (docEditor) {
                docEditor.destroyEditor();
            }
        };
    }, []);

Ideally I don’t want to save the document I just want access to the form data, maybe using GetFormsData?

Hello @hanland
I believe you should check our integration samples and compare them with your integration: Language-specific examples | ONLYOFFICE
As for your code, probably the issue is related to the mode parameter, didn’t find it in your sample:
Permissions | ONLYOFFICE
Filling in forms will only be available for the document and pdf editors if the mode parameter is set to edit.