Flatten the Document with JavaScript

Long story short, I want to flatten PDF using JavaScript forms. With a combination of AcroScript and PowerShell, I made many automation which creates filled in advance forms from a CSV file. Now, I want to combine forms generated in a single PDF file (especially if I can eventually print generated both forms daily). Set all fields to read only not avoiding all fields with the same name to replicate with each other. For example, I may have a form field called customerName and PDF forms for each clients John, Mary and Sally. So when I combine all three PDFs there are now three fields in this single document named cusomterName and the value of each field will be John (instead of John, Mary and Sally). Flattening of the document is the only way I can think to avoid this problem. I can do it manually, but I'd like to integrate this into my AcroScripts. How do flatten you a document with AcroScript or if anyone out there has another solution for my situation I'm all ears.

I use Acrobat Pro XI on Windows. I can't use any kind of cloud solutions due to my employer's strict security restrictions.

Thanks in advance.

NVM. Found my answer. For those who also need here, is:

oProfile var = Preflight.getProfileByName ("flatten annotations and form fields")

var oThermometer = app.thermometer;

var myPreflightResult = this.preflight (oProfile, false, oThermometer);

Tags: Acrobat

Similar Questions

  • The document with the hover text

    I have a requirement to post a technical document with javascript features hover in which a ball or text box appears when someone passes on a hard word or phrase.

    See the image below to get an idea of what I'm trying to achieve.

    Can anyone advise a solution?

    Thank you!

    hover text.png

    http://jQueryUI.com/ToolTip/

  • sign the document with 'Draw my signature' and send it via http-post

    Hello

    I have a pdf document with a signature field. When im opening with AcrobatReader XI, I can sign / Place Signature / draw my signature. I can't 'save a copy '. It works pretty well.

    Now, I place a button in the pdf document to be sent via http post to a given address. When I now open this PDF in the XI AcrobatReader, trying to sign. I can only do this with sign / Place Signature / use a certificate. But there is no way to "draw my signature."

    Did I miss an option to do this? Pls tell me if he has a chance to sign the document with 'Draw my signature' and send it via http-post.

    Or is this part of the concept? When I'm looking for a solution, I found EchoSign electronic signature.

    What is available depends on how the as is put in place. If you include a button with an action of type 'Submit form' and/or reader - enable the form, then e-signature (signature of drawing) will not be available in the player. If the document is compatible player then digitally signing will. So for what you want, do not Reader-enable the document and you can use the submitForm JavaScript method to submit. The site that has the JavaScript documentation was not available at the time I wrote this, but post again if you need help with that.

  • find all the documents with a link specific filePath

    Hello

    I am trying to find the name of all the documents with a link specific filePath.

    Before you run this script I need to know that nothing bad is going to pass, so please can someone give me some advice?

    var myFolder = file (' A:\Work in progress/Jake/Indd files / ');
    myDocs var = [];
    var myFiles = myFolder.getFiles("*");

    for (i = 0; i < myFiles.length; i ++) {}

    $.writeln (myFiles [i] p:System.NET.mail.MailAddress.DisplayName);
    var doc is myFiles [i] .open ();.
    links documentaries var = doc.links;
    for (j = 0; j < docLinks.length; j ++) {}
    If (docLinks [i] .filePath = 'A:\Work in progress\Jake\Image Links\Aqualimb 100kg\Aqua Limb.eps') {}
    myDocs.push (doc.name)
    }
    doc. Close();
    }

    Try this

    var myFolder = Folder ("A:\Work in progress/Jake/Indd Files/");
    var myDocs=[];
    var myFiles = myFolder.getFiles("*.*");
    for (i=0;i		   
  • Cannot open the document with 'failed to load Composition.

    After confronting an error message when posting, I can not re open the document with the message "failed to load composition.

    I desperately need to save this document! are there opportunities to save him?

    the screenshot is here.

    javascriptLoading Error.png

    This is the error you get when you open the content published on the web. It is a bug, but you can use the fix below.

    Open the publish/web/index_edge.js and remove the "use strict"; statement at the beginning.

    This will fix the problem. We will address this in the next version.

  • How can I trigger "Add tags to the document" via JavaScript?

    How can I trigger "Add tags to the document" via JavaScript? I am trying to add this fuction ITextSharp if when the user opens the pdf it could mark the document once it is opened automatically

    Is not possible.

  • How to paste into the text field of the Clipboard with JavaScript?

    I implement the following actions in the form of javascript:

    1. a user clicks on a link on the PDF to open a web page

    2. the user uses the web page to find information and then copy text from the web page

    3. the user clicks a button on the pdf form and it formats the text to the Clipboard and paste them into the text fields.

    I can't find any references for the reading of the data from the Clipboard with javascript in PDF Forms. is it not possible?

    Perhaps 'not possible' was a little too hard. It would be a security hole if she accepts a script in a form to copy the contents of the Clipboard without the user explicitly allowing it. It has been possible to copy the contents of the Clipboard into a form field using the app.execMenuItem method without the user knowing / allowing it, but that hole was closed. The restriction can be overcome, as explained in the documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.143.html

  • Fill the Document with the prices of the worksheet

    Hi everyone, I don't know if it's a general question or a challenge for the gurus of scripts.

    I have a huge task in front of me where I need to add prices to individual product copy items depends on the unique code for each product. As you can see in the attachment, I have a master document with applied styles that I will use throughout a catalogue I produce from scratch. The problem is that I have only gave me prices in a spreadsheet after I had already crossed and style the master copy, so for the moment, I have a lot of symbols of Sterling without price.

    Is there a method or plugin I can use that will use the excel sheet to find the product code in a single column use the value of the adjacent copy and add the price of the site appropriate?

    I downloaded the demo for WoodWing's Smart Catalog but is a bit overwhelming in its learning curve because I need super fast results!

    Thanks in advance.

    Lewis

    Hello

    I could offer you my help--but only if you work on PC

    but for this simple task you can use the script called FindChangeByList located in the example scripts folder in your installation of CS4 - [] \Adobe InDesign CS4\Scripts\Scripts Panel\Samples\ and subfolders JavaScript or VBScript file

    contents of your FindChangeList.txt file might look like this:

    text {findWhat: "R883"} {changeTo: "£ 69.00"}

    or if you need to preserve the "code":

    text {findWhat: "R883"} {changeTo: "R883\t £69.00"}

    You can replace '\t' "" (space)

    I think you can build your pretty easy FindChangeList.txt file by adding a few new columns in your Excel and then export to txt file

    Robin

    www.adobescripts.co.UK

  • Stimulant of the button with javascript under a button in pdf format

    Hi all

    Is it possible to stimulate using acrobat javascript or javascript livecycle @under a key press button?

    For ex. I click on a button and who work as Atl + F (File menu) or win + R (run box) under windows.

    Hope this is clear.

    Thank you

    Arvind

    LiveCycle Designer uses the same JavaScript engine that Acrobat and Reader when the LiveCycle form is in PDF format. So, as stated in the form Acrobat JavaScript, the JavaScript engine and capabilities. As explained in the Acrobat JavaScript forum, JavaScript used in Acrobat or Reader is the willingness to 'sand' or very isolated from the JavaScript of your computer program. This was done to protect users of form Acrobat or Reader to run malicious code.

    It might be possible if you were writing a plugin add-on using a computer program have complied and the information provided in the Acrobat SDK kit. You must manually install this program on your system. For others to use the code, you will need to register as a developer with Adobe and have each user to install the code on their system at their own risk.

  • What version of Adobe allows you to change the page on some pages orientaion and save the document with just a few of the tours pages?

    What version of Adobe allows you to change the orientation of the page on some pages and save the document (PDF) with only a few of the tours pages?

    Adobe is the name of the company, not the software as many people say. Since you want to know the exact software, it is important to know that.

    Any version of Acrobat Standard or Acrobat Pro to do this. These are commercial software (a cool weather or subscription).  The free Adobe Reader or Acrobat Reader cannot do this.

    Tip: there are two ways to turn the pages; alone will save him.

  • CC2015: Display the document with its print in Design view style rules

    A style sheet may contain rules that only effects of impression.

    Example:

    @media print {}

    How can I view a document in design mode with these rules, taking effect?

    In other words: I want to display the document as if you choose ' file > print preview "in a browser.

    In the old Version of Dreamweaver, there was a command "View Menu > use Style > Print Media" (I'm not shure which is the name in English, because I use the interface in German).

    Thank you.

    Hello

    I'm sorry to inform that this feature has been deprecated in Dreamweaver CC

    https://helpx.Adobe.com/Dreamweaver/using/the-new-modernized-Dreamweaver-CC-III.HTML#view

    As a work around you can do file > Preview in browser Page and then print from browser to check the preview before printing.

    Concerning

    Vivek

  • Resize the document with Tables

    I use InDesign CS6.

    I have more than 100 documents, with tables. I need to resize my documents 48 p 9 x 65 p 3 to the new small size 44 d 3 x 54 p 0.

    When resizing the document is it possible that tables will be will resize automatically also?

    New page in same proportions not same size of the original page size. So can not just scale the page more small.

    But you can scale a table if you to scale the block of text that appear in the table. Make the text frame exactly the same size as the table. Then hold down the Cmd/CTRL + SHIFT and scale the text block to a corner.

  • Scripts to insert metadata automatically to the document with the paragraph style

    Hello

    I am trying to find a way to insert automatically the metadata in my document through paragraph style in indesign cs5.5.

    It comes to myDocument title, author name , and description of myDocument.

    Is there anyone who can help me with this project?

    Thank you.

    Place the script at the following location: C:\Program Files\Adobe\Adobe InDesign CS6\Scripts\startup scripts

    If you close it document the script will automatically put the metadata in your indesign file (use ctrl + w or menu-> file-> the option close to close the file)

    Code:

    #targetengine session

    If you want to test the script for your active document, comment on the threshold of another, copy the script to your startup folder

    app.menuActions.itemByName ("Close").eventListeners.add ("beforeInvoke", function()

    {

    myDoc var = app.activeDocument;

    var docTitleText ="";

    var docDescripText ="";

    app.findGrepPreferences = app.changeGrepPreferences = null;

    app.findGrepPreferences.findWhat = '. +';

    found = app.activeDocument.findGrep (true);

    for (j = found.length - 1; j > = 0; j-)

    {

    var foundText = .silence found [j];

    You can set several style of paragraph for the title of the Document

    if(found[j].texts[0].appliedParagraphStyle.Name=="docTitle1")

    {

    docTitleText = found .silence [j];

    }

    of other if(found[j].texts[0].appliedParagraphStyle.name=="docTitle2")

    {

    docTitleText = docTitleText + "" + found .silence [j];

    }

    of other if(found[j].texts[0].appliedParagraphStyle.name=="docTitle3")

    {

    docTitleText = docTitleText + "" + found .silence [j];

    }

    You can define several paragraph of Description of Document style

    of other if(found[j].texts[0].appliedParagraphStyle.name=="docDescription1")

    {

    docDescripText = found .silence [j];

    }

    of other if(found[j].texts[0].appliedParagraphStyle.name=="docDescription2")

    {

    docDescripText = docDescripText + "" + found .silence [j];

    }

    of other if(found[j].texts[0].appliedParagraphStyle.name=="docDescription3")

    {

    docDescripText = docDescripText + "" + found .silence [j];

    }

    }

    with (myDoc.metadataPreferences) {}

    author = "My Name";

    documentTitle = docTitleText;

    Description = docDescripText;

    }

    });

    Vandy

  • Open and close the Popup with Javascript

    Using Apex 3.2

    I probably have done this lots of times in my old job, but do not have access to the code and now I can't work properly.

    I opened a window pop up with javascript
    Now, I need to close and refresh the calling page, but only if it ratifies the validation on the popup.
    I have an item hidden on my pop up called P7_FLAG.
    I have a process page after validation that affects P7_FLAG (only the value 1, if passes validation).
    I also have a "SUBMIT" button.

    So once I click my button "SUBMIT" page should look at validations, so ok, P7_FLAG the value 1, then close the popup and refresh the calling page.

    My current look of javascript like this
    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    var test = $x('P7_FLAG').value;
    if(test == '1')
    {
    window.close();
    window.opener.doSubmit('REFRESH');
    }
    }
    </script>
    My button
    javascript:saveChanges();
    The problem is that I need to click twice on the button SUBMIT.
    First, it sets P7_FLAG
    Second time, it closes page and refreshes.

    I probably made a fundamental mistake, but today I can't.

    See you soon

    Gus

    Published by: Gus C 10 may 2012 12:48

    Sorry about that I was blind

    Add this function to your page

    
    

    Call this function on the loading of the page

    onload="onloadclose();"
    
  • How to see the file name of the document with the full path when you move mouse title bar?

    PS CS6 using, Windows 7 x 64.

    I was under the impression that when my mouse hovering over the title bar of the document, I would see a ToolTip showing the full file name, including the path.  This isn't the case and I wonder if there is a way to do it.  I know that I can click on file > save as, or Ctrl-Shift - S to see the full path, but hoving over the title bar would be easier.  (What I now see in the ToolTip is the name of the file, % magnification and layer that I selected.)  Basically, the ToolTip is showing just what is in the title without hovering bar.)

    Thank you!

    John

    AHA, I think it's a view tabbed vs thing windowed mode...

    I do not think that trying to change the way you manage your documents, well that--most people like one way or the other and stick with it.

    -Christmas

Maybe you are looking for