"import as layer" with javascript?

Hello!

I was wondering if there is one here who could give me some batch processing javascript in Acrobat tips. My problem is the following... I have many (thousands) of pdf that have an object on a layer with incorrect data. In Illustrator, I wrote a script which allows to reconstruct this object fills with correct data from a csv file and then saves in a pdf file with a name that matches the master pdf, in that it must be inserted.

What I want to do with a batchscript of javascript is for each open file is to find the file name and the newly created pdf file is found (done) then do something equivalent to the command "import as layer" and import to an existing layer already in the main PDF so the new masks the old object. This I can't do... Well, really, I can't do a lot with js in acrobat for that matter. I can't even a var to return a value to the colsole for testing. It returns no "defined."

I can find the layer I need to manipulate with ' this .getOCGs () [0] ", the layer I need to handle reaches zero and using the"Merge layers"example in the Guide scripts JavaScript Acrobat a layers properties are modified to match the target layer but it always appears as a distinct physical layer.

What I just wrote is unable to make sense of bones of bunch so in other words... What I want to do with javascript, it is the action of the "Import under the layer" option selected in the layers panel in mirror. The function key I want to make is in the 'Options of Import' is to 'add to the existing layer.

I appreciate any help that can be offered.

JT

There is much that can be done with JavaScript in Acrobat.
As far as I know, you can add or merge a layer directly, but you can add a BCG with the addWatermarkFromFile() method.

About the console, simply run your code and either select the name of the variable you want to examine or type it, and then press Ctrl + Enter. It displays its value. For example, if you run this code:
var a = 2 + 5;
one;

The result will be "7".

Tags: Acrobat

Similar Questions

  • Definition of the color layer with javascript property

    Is it possible to set the color of a layer in the layers palette using javascript?

    By default, everything appears colorless layer, but if you right-click (ctrl-click) on a layer you can change the color of red, Orange, yellow, etc..

    My question is can I do this with a script?

    I can lock a layer, modify its visibility and opacity, but I can't find a reference to this particular property.

    Any help is appreciated.

    Thank you


    Zara

    This will set the color of the active layer...

    layerColour("Violet");
    
    function layerColour(colour) {
        switch (colour.toLocaleLowerCase()){
            case 'red': colour = 'Rd  '; break;
            case 'orange' : colour = 'Orng'; break;
            case 'yellow' : colour = 'Ylw '; break;
            case 'yellow' : colour = 'Ylw '; break;
            case 'green' : colour = 'Grn '; break;
            case 'blue' : colour = 'Bl  '; break;
            case 'violet' : colour = 'Vlt '; break;
            case 'gray' : colour = 'Gry '; break;
            case 'none' : colour = 'None'; break;
            default : colour = 'None'; break;
            }
        var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc.putReference( charIDToTypeID('null'), ref );
            var desc2 = new ActionDescriptor();
            desc2.putEnumerated( charIDToTypeID('Clr '), charIDToTypeID('Clr '), charIDToTypeID(colour) );
        desc.putObject( charIDToTypeID('T   '), charIDToTypeID('Lyr '), desc2 );
        executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
    };
    
  • release all transparent strokes on a layer with javascript

    Hi all!

    I'm doing a script that converts groupitems pathitems on a layer. I found a script here, which dissociates to group items in a layer.

    var thisDoc = app.activeDocument;

    myLayer var = app.activeDocument.activeLayer;

    Var thisDoc.activeLayer.groupItems = group;

    for (d = 0; d < group.length; d ++) {}

    var mygroups = Group [d];

    for (i = mygroups.pageItems.length - 1; i > = 0; i--)

    mygroups.pageItems [i] .move (myLayer, ElementPlacement.PLACEATBEGINNING);

    }

    Is there a way to also release traces transparent in the group items so that they become individual pathItems as well?

    Thank you

    It's what you want.

    function test(){
    
        function dismantle(group){
            var prnt = group.parent;
            var cont = (group.typename == 'CompoundPathItem') ? "pathItems" : "pageItems";
            var insertIdx = (function(){
                var ln = prnt.pageItems.length;
                for(var i=0; i-1; i--){
                var item = group[cont][i];
                item.move(insertIdx, ElementPlacement.PLACEAFTER);
            }
        }
    
        function breakUpLayer(layer){
            while(layer.groupItems.length>0 || layer.compoundPathItems.length>0){
                var groupIdx = layer.groupItems.length-1;
                while(groupIdx>-1){
                    dismantle(layer.groupItems[groupIdx]);
                    groupIdx--;
                }
    
                var compIdx = layer.compoundPathItems.length-1;
                while(compIdx>-1){
                    dismantle(layer.compoundPathItems[compIdx]);
                    compIdx--;
                }
    
                redraw(); //hate to do this, but items.lengths do not update otherwise.
            }
        }
    
        if(app == "[Application Adobe Illustrator]" && app.documents.length>0){
            var doc=app.activeDocument;
            var firstLr = doc.layers[0];
    
            breakUpLayer(firstLr);
        }
    }
    
    test();
    

    I think the only problem you might encounter is the eccentric way Illustrator allows groups inside the CompoundPaths.  Crazy, no, because CompoundPathItem is not a property GroupShapes or PageItems, if you can get them using the method above.  In fact, it can get stuck in an infinite loop when it is like that!
    Really, this problem must be pretty RARE because nobody should be groups into transparent paths.  But for safety it is best connected the ETSK, then you can stop debugging, if such a problem occurs.  You can also build a security counter to get out you of the loop.  What a freak!

  • How to evaluate the blend if settings with javascript

    Some time ago, someone in the MacIntosh forum declared their wish to use a layer result of the Layer Style mixture if parameter as a mask (for some reason any).

    "The layer of the ' this 'effect is easily converted to a mask by combining and flattening the layer and using the transparency resulting.

    «Underlying layer but the "'-setting seems harder (naturally because they depend on the content of the other layers).»

    Is there a way to get the current figures (for a RGB 32 file) blend If settings for a layer with JavaScript?

    Or is there a way to reset settings If This Layer-Blend, but leave unchanged the underlying layer settings?

    Any help appreciated.

    It seems I was mistaken. The merge options are not part of the layerEffects descriptor. At least not in CS4. There was a time where you had to use a script by Xbytor named Styles.js for the layerEffects descriptor. I tried as well, and also, she returns not all parameters of mixture.

    The Merge Options are stored as part of the Style When you save the Style as a preset or save it to disk as a .asl file. Take a look with a hex editor.

    This information has not been read in (via Styles.js) as part of the Style descriptor. I've updated Styles.js so that you can now get the mixture descriptor Options:

    http://PS-scripts.com/BB/viewtopic.php?t=2759

    X

  • Play HTML5 video with JavaScript does not hide the overlay dimming video

    I googled this problem and found nothing useful and also checked the area of support here and still nothing. I'm creating a webpage with HTML5 video. I made a layer with the video object that is hidden with CSS, until the user clicks on a link. When the user clicks on the link, I use a JavaScript function to display and play the HTML5 video object. Works fine except that Firefox keeps the overlay in place play button while playing my video! If I click on the overlay, the video stops. Then if I click again, the overlay disappears and the video resumes playback.

    I realize there are solutions that can be pirated. But it is certainly a bug that the rest overlay in place after the start of the video via a JavaScript command. I hope that this problem finds its way to the right people at Mozilla for resolution.

    Thank you
    -DK

    Can you please update to Firefox 18.0.1 and see if the problem exists in a new profile? (13 is no longer supported)

    Use the Profile Manager to create and delete profiles Firefox

    If this happens again please give an example of site Web with the show and the screenshots of what should happen compared to what's going on

  • Is it possible to import a layer group into a project to another project?

    Hi all

    I am currently using after effects 5... Yes it is version 5, not CS5.

    I'm trying to figure out if I can import a layer group and their applied effects in another project while keeping all the editable attributes and positions of the imported layers with respect to one another.

    I see that I can import an ASP project file into another project through the FILE to be IMPORTED, but just, which brings the raw project window files/layers and don't place no layers in the timeline with all their positions, the effects and the edited attributes, how I had like.

    Also tried to previously compose the layer, but who did not leave their editable once a demo was made... just makes the 7 layers I want to import in to another project all one layer and not let them be changed the way the 7 layers are separately.

    In Adobe Premiere, there is a real ' IMPORT the PROJECT ' selection under IMPORT that allows me to import an entire project in another project and allows me to place the imported project where I want in the new project editing... that's what I try to do in After Effects.

    I realize that there may be a way easy to make it in one of its latest versions of After Effects and the other may say, 'just buy the new AE CS5', but I figured out allot of things on my own so far and I love after effects 5 for what I do now... maybe later on the newer version.

    Thank you for any input,

    Digi

    Just import the source project in the new project.  Open the original composition, select the layers you want and copy.  Then, open the new composition and paste.

    If you want to be really ordered on this subject, you can make a temporary version of the source project that contains only the layers you want to move to the new project.  Import this temp project to the new, then you can delete the temp project.

  • In Apple Mail, I managed to import a box mailbox, but I can't move the mailbox imported to be with the rest of my mail

    I accidentally deleted one of my 4 Apple Mail accounts.  Using my backup, I followed the procedures of Apple and successfully imported this box to my backup hard drive letters.

    Using Apple Mail, I managed to import the box mailboxes in Apple Mail from my backup, (the mails I wanted are) but I can't MOVE the mailbox imported to be with my other 3 mail accounts.  This folder contains 2 files, incoming messages and sent messages.

    I wanted to move the 'Import' folder to the "Mailboxes" section in the sidebar (just below ' boxes ' are my 3 "Inbox". Below are my 3 sent icons. (it looks like a paper airplane).

    I even tried to create a new Inbox mailbox, but this new mailbox does not have anything new under the "Inbox" and "Sent" icons.

    Try to add the account back and then copy import emails to the mailbox to the appropriate account.

  • Is no longer able to view live on Alexei_tchernomor even content with javascript active.

    I had no problems until recently - has always been able to view their videos. I never had installed oracle java plug-in, but had javascript activated via subject: config and everything worked properly. Now, I am unable to view the videos on the site with javascript active. I use noscript and java is enabled in the options for this site. Any help would be appreciated. I have the site enabled in my firewall.

    I'm glad that you found the help page because I wasn't going to be able to answer that one.

  • How do I import my favorites with 7.01?

    I just loaded Ubuntu 11.10, I try to import my bookmarks in Firefox, but do not see the import bookmarks from the bookmark library. How do I import my favorites with 7.01?

    Ubuntu 11. XX shows the window menus in the control bar at the top of the screen with the switch to the window of the Unit Manager.

    Click bookmarks/view all bookmarks, and then move your mouse to the upper left corner to the Firefox Web browser.

    You will get a pop up menu (Organization, views and import and backup).

  • Is it possible to work with JavaScript in JUST ONE TAB and not on others

    I usually browse websites with javascript is disabled. But sites like facebook and youtube need javascript. So what I really want is to just run these sites on legs with active javascript and run the other tabs without it.

    Try noscript. It can be a pain to get the installer at the beginning because you need allow all areas that you want to allow JavaScript for, but that market either tabs or windows.

    https://addons.Mozilla.org/en-us/Firefox/addon/NoScript/

  • How to change rootIndexPath with javascript

    I wish I could change the value of rootIndexPath with javascript. Is this possible?

    I can see the value of rootIndexPath with

    {Label

    text: "" root path Index: "+ listview.rootIndexPath ;}"

    but I can't change the value. Here's the code I'm trying to fix

    example:

    Button {}
    text: 'run '.
    onClicked: {}
    listview.rootIndexPath = 1;
    } //end onClicked

    } //end button

    {To ListView
    rootIndexPath: [2]
    ID: listview
    dataModel: {XmlDataModel}
    Source: "simplelist.xml".
    } //end dataModel

    } //end listview

    Have you tried with:

    listview.rootIndexPath=[1];
    

    Alternatively, tou can try with:

    var tmp = rootIndexPath;
    tmp[0] = 1;
    rootIndexPath = tmp;
    

    or maybe with:

    listview.setRootIndexPath( [1] );
    

    Let me know

  • ADF - image source Set with JavaScript

    Hello.

    I have a layout grid panel with multiple lines and cells.

    Each cell contains a text and a picture, all surrounded by a command binding.

    My output text have the value #{MyBean.valueMyBean}

    My image have the source /directory1/directory2 / # {MyBean.valueMyBean} .jpg

    What I want is that whenever I click on that image, image and its corresponding output text takes the same value (simulating the selected item)

    I want to do with JavaScript, because when I do it with partial triggers there is a delay, and it does not work for the needs.

    Could you help me put who implemented?

    I don't have an idea to change the source of an image with JavaScript.

    You can join af:clientListener for the image and call the javascript function that will be:

    -find the component target, something like: var targetImg = AdfPage.PAGE.findComponent (clientId);

    -change the property 'source', something like: targetImg.setSource ("new source");

    Here you can find more information about adf api client-side: http://docs.oracle.com/cd/E24382_01/web.1112/e16181/af_arch.htm#ADFUI10042

    Dario

  • Client with JavaScript listener, surrounded by a button have a delay

    Hello.

    I have a fragment page (jsff) with a resulting keypad buttons surrounded by a client listener that calls a java script function; whenever I click on a number it refresh a text with the concatenated value input. I've implemented with JavaScript. Why with JavaScript? Because of the delay using partial triggers showing the value in the input text.

    When I test it on the server, it works fine. I click on each button and have a little late, but it works for the needs to develop.

    Now, when I insert this fragment inside an another jsff which include several elements, the result is not the same. I click every button and the value is displayed in the text of entry very fast, but the I clicked on the button takes between one and two seconds to recharge for summer clicked again. I don't understand what is happening.

    Could someone help me?


    Thank you very much.

    Probably you always spread the event on the server. You can easily check this with a browser like Firefox/Firebug plugin, sent to see if there is no request for the server.

    Normally, you will need to explicitly cancel the event to propagate to the server. For example, if you have a clientListener on a button, you do something like below:

    function showPopupFromAction(actionEvent)
    {
      actionEvent.cancel();
    //your logic here

    }

  • Is it possible with javascript to compile the data entered by the user in an easy format to excel?

    I have a form in which the user enters several lines of data as well as additional information on these data.  I would like finally to export data, so I can manipulate the Excel.  This is possible because javascript (or otherwise)?  Here is an example of what I mean.

    The form of a table in which the user enters each of the names of his friend, their favorite color and their age.  I want the name of the specific friend linked to their favorite color and age so when I export to excel I can see how many friends has the user whose favorite color is red.

    If the form data would be as follows:

    Friend1name

    Friend2name

    Friend3name

    Friend1color

    Friend2color

    Friend3color

    Friend1age

    Friend2age

    Friend3age

    When I export the data as entered above, the results of each field in another column.

    Anyone has any ideas for that?

    It is possible with JavaScript. You can write the data to the JavaScript console and then copy & paste into Excel, or write to a file as an attachment (aka data object) and export it. Here's a sample script that writes the field data in the JavaScript console:

    Table of domain names

    Invoke the var = ['Friend1name', 'Friend2name', 'Friend3name', 'Friend1color', 'Friend2color', 'Friend3color', 'Friend1age', 'Friend2age', 'Friend3age'];

    Browse the fields and write the field values in the console

    for (var i = 0; i)< afields.length;="" i="" +="1)">

    Console.println (getField(aFields[i]).valueAsString);

    }

    Display console

    Console.Show ();

    You can place this code in the mouse event to the top of a button and click the button to run it. This last line of code displays the console and you will be able to copy & paste the data.

  • I'm trying to generate an arithmetic and geometric series/sequence with JavaScript.

    I try to generate an average arithmetic and geometric
    series/sequence with JavaScript. The thing that makes this challenge is that
    I use user input to determine the parts of the formula that I use for
    generate each sequence. I tried running the formulas, but I learned that I was
    channels running through them and not numbers. How to generate my
    sequences/series and always use user input? PS, here's my formulas: (a1-East
    first term, d and r are difference/ratio, and n is the n-th term)

    1.) a1 + d * n  

    2.)a1 * r^n

    Entry user of a form is always a string. There are several ways to convert a string to a number in JavaScript:

    • Pass it as an argument to Number()
    • Pass it as an argument to parseInt() (for an integer)
    • Pass it as an argument to parseFloat() (for a floating-point number)

Maybe you are looking for

  • Call on iPhone transfer

    Android phone (some or all) offers a call forwarding option (provided that the mobile network operator supports). This issue is specifically for call transfer and not call front/reference. We have a similar option available for the iPhone? Example: A

  • Portege M200 - what CPU should I use?

    HelloI purchased a M200 with a processor of Pentium M 1, 5 GHz. Now, I want to put the fastest CPU in it. Which is the fastest CPU you can put in? What is the M745 Pentium, Pentium M745a or Pentium M750?Sorry for my Wnglish, I came from Latvia.

  • 4635 Officejet prints black box in the header instead of jpeg image

    I have an Officejet 4635. I got it for probably about a year. Never had problems printing with it before. Recently, when I try to print a doc word with a jpeg image in the header, the image will print as a black box. I recently got a new router - an

  • Error vista sp1 installation

    I get install error 80073712 when I try to install sp1 for Vista Home premium 32-bit. So I ran update readiness tool and wga Diagnostics and here are the results: WGA tool: Diagnostic report (1.9.0027.0):-----------------------------------------Valid

  • Error fatal \Software

    I use the latest SW and SW HP on the web to install drivers for my 5610 all-in-One on my new Win PC Pro 8.1. I get the following error "Could not write value to key \Software." The message also told me to search for "Fatal Error" and "MSI. GPBaseServ