Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Attach pdf in to a pdf using javascript. Sample code please...

New Here ,
Apr 27, 2023 Apr 27, 2023

Attach pdf in to a pdf using javascript. Sample code please...

TOPICS
JavaScript
2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Apr 27, 2023 Apr 27, 2023

Go to the "Security (Enhanced)" tab of the Preferences dialog and uncheck the "Enable Enhanced Security" box, as well as "View in Protected Mode", "Run in AppContainer" or anything else with a similar name.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2023 Apr 27, 2023

Please don't ask for sample code. What code have you tried? Perhaps we can help you fix it. Or do you want to know if it's possible, and which methods to use?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2023 Apr 27, 2023

Here is my code

var attachPreparerChecklist = app.trustedFunction( function()
{
app.beginPriv();
var preparerChecklist_Path = global.checkListBase_Path + "2022 Preparer Checklist.pdf";
(global.lastDoc).importDataObject("Preparer Checklist", preparerChecklist_Path);
app.alert("\nPreparer Checklist is Attached Successfully", 1, 0, "Preparer Checklist Attachment");
app.endPriv();
});

global.lastDoc is nothing but "this"
preparerChecklist_Path is "/wlt-data-1/Adobe/AdobeAutomationDontDelete/04_ChecklistBase/2022 Fresh Return Checklist.pdf"

It is woring fine in Acrobat X Std, but not in Acrobat DC Pro. Also not throwing any errors.

Note: This is a folder level javascript plugin.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2023 Apr 27, 2023

Here is my code

var attachPreparerChecklist = app.trustedFunction( function()
{
app.beginPriv();
var preparerChecklist_Path = global.checkListBase_Path + "2022 Preparer Checklist.pdf";
(global.lastDoc).importDataObject("Preparer Checklist", preparerChecklist_Path);
app.alert("\nPreparer Checklist is Attached Successfully", 1, 0, "Preparer Checklist Attachment");
app.endPriv();
});

global.lastDoc is nothing but "this"
preparerChecklist_Path is "/wlt-data-1/Adobe/AdobeAutomationDontDelete/04_ChecklistBase/2022 Preparer Checklist.pdf"

It is woring fine in Acrobat X Std, but not in Acrobat DC Pro. Also not throwing any errors.

Note: This is a folder level javascript plugin.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2023 Apr 27, 2023

This is intolerably rude.

See https://community.adobe.com/t5/acrobat-discussions/acrobat-javascript/td-p/13752918

Please do NOT start new discussions, without linking to the old one.

Please do NOT register new users to make it look like a new discussion.

Or, please NEVER allow multiple members of the same team to start the same discussion separately.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2023 Apr 27, 2023

Then what is the error in my code? The same code worikng fine in Acrobat X Std. But not working or trrowing any error in Acrobat DC Pro. Is this a bug in Acrobat Javascript plugin. I have creatred more than 70+ pluginns in acrobat X std. This one plugin is struggling me a lot. Please help. Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2023 Apr 27, 2023

Go to the "Security (Enhanced)" tab of the Preferences dialog and uncheck the "Enable Enhanced Security" box, as well as "View in Protected Mode", "Run in AppContainer" or anything else with a similar name.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2023 Apr 27, 2023
LATEST

Thats a Great Help. It is woking fine now. Thank you so much!   : )

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines