Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Unable to make Print and Clear button on PDF within browser

Avatar

Level 4

Hi folks

We have XFA based static PDF which is developed in Designer, it has print and clear button which works fine on Adobe Acrobat Reader and Professional but when PDF is opened in chrome or IE then button stops working?

Code written is xfa.hosts.resetData() which is called on click event with RunAt "Client and Server" set?

Default form properties:

Default language: javascript

Default Run At: Client and Server

 

 

However same form which was earlier developed on inDesign and same js and is working fine on browser.

 

Any pointers to share

 

AEM 6.2

JEE

PDF generated using AEM JEE workflow

 

 

Manu

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi there,

 

you must have something else that would interfere with this line of code...

Although, xfa.host.resetData(), doesn't have an 's' at the end of "host".

I'm trying the same thing on a blank static PDF form within IE and it works fine. I tried "Client" or "Client and Server".

 

Look around if you can find any other code.

 

Also... maybe you could test something out, verify what is the viewer type when opening the PDF with the browser.

Use the following line to display what is the application handling PDFs within the browser.

app.alert(app.viewerType);

xfa PDFs are not compatible with every PDF viewer...

 

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

Hi there,

 

you must have something else that would interfere with this line of code...

Although, xfa.host.resetData(), doesn't have an 's' at the end of "host".

I'm trying the same thing on a blank static PDF form within IE and it works fine. I tried "Client" or "Client and Server".

 

Look around if you can find any other code.

 

Also... maybe you could test something out, verify what is the viewer type when opening the PDF with the browser.

Use the following line to display what is the application handling PDFs within the browser.

app.alert(app.viewerType);

xfa PDFs are not compatible with every PDF viewer...

 

Avatar

Level 4

Thanks for response but I have issue with IE some security settings is restricting me to open any pdf on IE so using Chrome Version 78.0.3904.87 (Official Build) (32-bit) where I am able to open PDF but javascript is not at all working. Even I tried creating PDF from sample templates and included OOB reset button but nothing happens on PDF when it is opened on chrome browser

 

Avatar

Level 10

Unfortunately, Google Chrome is no longer compatible with Acrobat software. Any JavaScript within a PDF is no longer supported by the browser.

 

Here are some tips related to browsers if some can be handy for you.

https://helpx.adobe.com/ca/acrobat/kb/pdf-browser-plugin-configuration.html

 

Speculations about Chrome with PDF JavaScript

https://answers.acrobatusers.com/Chrome-Javascript--q288206.aspx

 

Avatar

Level 4
I checked on IE11 its working fine, however i observed the forms developed in Adobe InDesign have javascript working on Chrome also on same version. Can you explain the reason for same and how can I make it work for Chrome?

Avatar

Level 10
I am not familiar with InDesign, but I'm pretty sure that creating PDF forms using InDesign does not create XFA based forms. It is probably creating PDF using AcroForm standardized as ISO 32000.