Skip to main content
Participant
September 23, 2023
Question

Unable to pre-load data

  • September 23, 2023
  • 0 replies
  • 410 views

I am unable to preload data on AdobeDCView

 

 document.addEventListener("adobe_dc_view_sdk.ready", function () {
        var adobeDCView = new AdobeDC.View({clientId: "XXXXXXXXXXXXXX", divId: "adobe-dc-view"});
        adobeDCView.previewFile({
            content: {location: {url: "http://localhost/test.pdf"}},
            metaData: {fileName: "test.pdf"}
        }, {});

        // Data you want to pre-fill
        adobeDCView.registerCallback(
            AdobeDC.View.Enum.CallbackType.PAGE_VIEW,
            function () {
                // Data you want to pre-fill
                var prefilledData = {
                    "emp_fn": {value: "John"},
                    "emp_ln": {value: "Doe"}
                    // ... any other field names and their values
                };

                // Set the form fields with the prefilled data
                adobeDCView.setFormFields(prefilledData);
            },
            true
        );

    });//event listener

 

This topic has been closed for replies.