Why do I have to run a  doc.saveAs() prior to Inserting, Deleteing, or Extracting pages?

MY SETUP:
I'm using folder level javascripts.   In Acrobat I have the 'enable menue items javascript execution privledge' enabled,  In my actual folder level scrips I have them wrapped in a trusted function along with app.beginPriv()/app.endPriv().    My PDF's are coming from LiveCycle Designer which I then open and run in Acrobat.
MY QUESTION:
Through much trial and error and banging my head on the wall I've found that if I want to use insertPages(), extractPages() or deletePages() called as a trusted fucntion  on its own it won't work unless I first run a saveAs() function to create a new document file and only then can I run the desired function on the new saveAs'd doc.   I simply can't run an insertPages() on the current open doc without a saveAs first().    
Why is that?
I find that very frusterating and the resulting errors aren't a help.  If I don't SaveAs first I get security error or invalid function errors.
EXAMPLE:
Save As Function:
var LCB_SaveAs = app.trustedFunction(function(doc, filename) {
    app.beginPriv();
    doc.saveAs(filename);
    app.endPriv();
Insert Page Function:
var TEST_InsertPage = app.trustedFunction(function(doc, filename) {
    app.beginPriv();
       doc.insertPages ({
           nPage: -1,
           cPath: filename
       app.endPriv();
Javascript code in document to call the above functions:
if(typeof(LCB_SaveAs) == "function") {
    if(typeof(TEST_InsertPage) == "function") {
        try {
            TempFileLocation = "/C/PATH/InsertTemp.pdf"
            LCB_SaveAs(event.target, TempFileLocation);
            try {
                PathOfInsertDoc = "/C/PATH/FileToInsertIntoSaveAs'dDoc.pdf"
                TEST_InsertPage(event.target, PathOfInsertDoc)
            catch(e) {
                xfa.host.messageBox(e.toString().replace("RaiseError: ","") , 0, 0); 
        catch(e) {
            xfa.host.messageBox(e.toString().replace("RaiseError: ",""), 0, 0); 

Hi George.  Yes I'm using static XFA forms which were created with PDF's as basic 'artwork' in the background and then my custom fields and script tunning on top. 
I've tried running  a function (below) in the console, but did nothing -- maybe a syntack error.  I don't know what that may or may not mean though.  I'm not use to running stuff through the console so I could be doing it wrong.  My console experiance is limited to calling the path where the javascripts folder resides.
Attempt script in console:
var MJS_HN_Delete_RevisitForm = app.trustedFunction(function(doc) {
    app.beginPriv();
    doc.deletePages(15, 15);
    app.endPriv();
and/or this:
app.trustedFunction(function(doc) {
    app.beginPriv();
    doc.deletePages(15, 15);
    app.endPriv();

Similar Messages

  • Why do I have to open my docs on my ipad before I can download them on my macbook pro

    Hi all
    I have just started using iCloud. What I wanted to do is upload some docs and access them on my MacBook Pro later. I did this only to find that I couldent download the docs. Also the docs had a picture of the pages icon on the front. However I could download them on my ios devices. once I did, the pages icon disapeared and instead the document was a icon displaying the preview of the document.
    My qusetion is: why do I have to download my docs on my iPad before I can download them on my MacBook Pro?

    You can delete email before opening it. Now is a good time to read the manual, which will explain how.
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf

  • My word perfect documents have been changed to .doc but I can't open them in pages. ugh!

    my word perfect documents have been changed to .doc but I can't open them in pages. ugh!
    they are wpd files from around 2001-2003 that my Dad emailed me and on a PC was easy to simply relabel as .doc but despite this I cannot open in pages or convert to pages.
    Please can you help me?
    cheers!
    DT

    In fairness to Pages, only apps that can handle Word Perfect docs of that vintage can open them, either.  W
    As Viking said, changing the extension does nothing to the file structure & metadata of the document.  At one time Mac people didn't bother with the extensions, because they were simply a visible indicator of the app that made them, and the Mac would get that information from the file itself.
    Since you changed the extensions, some Windows apps may still use those extensions to tell them the file source. When they try to open a .wpd file as if it were a .doc file, they will get very confused.
    You can try to open the files by using the Menu> Open command, with the setting of "all files."  IF and only if the app can handle .wpd files, then maybe it will open it & ignore the extension.

  • Why do we have to run maintain summary template every time we add an accoun

    Added a new account under an existing summary account. The posting to new account does not get reflected under the summary account until we add/delete summary account.
    Why do we have to do so. We even run the "maintain summary template" every night but still we need to do add/delete summary account.
    Any help is appreciated.

    Unfortunately, the maintain program will not help you reflect the change. I am not sure if this would be considered as a bug, but the only workaround we used to do is add/delete the template. This could be time consuming especially if the template has to calculate huge number of account balances.

  • Why do I have to run the plug-in container in my processes constantly in this version? It takes up too much memory!

    The earlier version of Firefox did not run this plug-in container. Every time I would remove it from my processes it would kill videos etc. But, it was all fine in the older version of Firefox, so why the change? So I chose not to update Firefox. Then, the other day, I saw that is was automatically downloading and I turned off my computer because it wouldn't stop and I didn't give permission. When I got home I could not use Firefox and it took me hours to figure out how to get the internet back. Then I got Firefox back and this stupid process is running again. It takes up too much memory. I don't like a bunch of extra processes running like that. So, why can't I just use the old version? Is this process absolutely necessary?

    In the past the memory usage would end up as part of the Firefox program. Now with OOPP you can see it as a separate process and that makes it more noticeable.
    You can disable OOP if you want.<br />
    See http://kb.mozillazine.org/Plugin-container_and_out-of-process_plugins
    Your above posted system details show outdated plugin(s) with known security and stability risks.
    # Shockwave Flash 10.0 r42
    # Next Generation Java Plug-in 1.6.0_18 for Mozilla browsers
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    I don't know if these three with different copyright dates are all needed:
    # Version 0.9.17, copyright 2008-2010 Veetle Inchttp://www.veetle.com/
    # Version 0.9.17, Copyright 2006-2009 Veetle Inchttp://www.veetle.com/
    # Version 0.9.17, copyright 2006-2010 Veetle Inchttp://www.veetle.com/

  • Why do I have to Open and physically Save a provided .xlsx File in order to source it and process it in SSIS?

    It sounds CRAZY...but it's true and I proved it out over many tests...
    We receive a .xlsx File from an outside vendor. If we simply move the file over to our processing Path and then try to source it and process it in SSIS, we get this error...
    Exception from HRESULT: 0xC02020E8
    Error at Data Flow Task [Excel Source [1]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB Error has occurred.
    Error code: 0x80004005
    However, if we open the file and Save It and/or Save As to our processing library path, we can source the .xlsx File and process it accordingly.
    Why is this? Is it because something funky is happening under the covers when the the vendor creates and saves the .xlsx File and then when we open and save it on our network it then cleans it up?
    Is there anyway that we can get around this? I hate for the processing clerk to have to go through what seems like a meaningless task....but I cannot think of any way around this if we cannot source the original file. And a C# Edit Script using Microsoft.Interpol.Excel
    is not possible because we are not allowed to put Microsoft Office on the Server where the SSIS Package will eventually reside.
    Any thoughts...suggestions...etc...would be GREATLY appreciated.
    Thanks for your review and am very hopeful (Holding my breath) for a reply and possible solution and answer to this strangeness.
    ITBobbyP85

    First of all...THANK YOU ARTHUR!
    You're probably sick and tired of seeing my posts out here on this.
    We are running Microsoft Office 32-bit which is why I downloaded the 32-bit driver of Microsoft Access Database Engine 2010 from...
    http://www.microsoft.com/en-us/download/details.aspx?id=13255
    Sooooo I think what you're saying is that it is a Microsoft Office 2010 .xlsx File but utilizing the 32-bit Microsoft Access Database Engine 2010 only allows me to source as Microsoft Excel 2007.
    Nowwww....this will run on a Server...soooo a couple of questions...
    1.) Are you saying I need to use the 64-bit Microsoft Access Database Engine 2010 in order to process this file without having to open and Save it? Can I do that if we're running Microsoft Office 32-bit? Will I be able to source this on the Server because
    we cannot install Microsoft Office 2010 on the Server where this SSIS Package will live and breathe.
    2.) How can I tell which Microsoft Access Database 2010 Engine is on the server where this will eventually reside and run? 32-bit or 64-bit?
    Welllll...maybe a 3rd question...
    3.) Is there anyway to get around this driver dependency? Can I create a script to bulkcopy it and it would simply take what's on the server.
    Now mind you...we DO NOT have Microsoft Office installed on our server where this will reside...a licensing issue...
    So maybe now this explains my struggles with this damn file(excuse my French and frustration)...and why I was using a C# Edit Script to Open and Save the File until I then deployed it to the server and the Microsoft.Office.Interop.Excel DLL was not available
    on the Server because we cannot install Microsoft Office on the Server.
    Sooooo it seems as though I'm back at square one.
    UGH!
    Any additional help you can suggest or even if we can continue this "offline" would be GREATLY GREATLY appreciated.
    Thanks!

  • Why when I am converting a word doc into a PDF are some of the pages moving around. It appears to be

    Why when I am converting a 50 page word doc into a PDF using Acrobat XI Pro the pages are moving around.
    It appears to be happening in the places where the previous page is not a complete full page, just a half page.
    It is moving these pages up into the previous half page, but it is only moving them several lines into that page
    Which has totally distored my e-book.
    It is attaching all my pattern sheets at the very end of the file okay, etc.

    Also, to be more sure you get in the PDF what you are seeing in WORD, go to the print menu and select the Adobe PDF printer, then go back to editing. The is a feature of almost all word processors to reflow the document for best results with the attached printer. It is also one of the problems of using WORD forms that such form designers miss. If you don't like the reflow, many the Adobe PDF printer your default and always print to Acrobat. If you want it to go to a printer, then print from Acrobat to that printer and it should remain intact. The other way to avoid the reflow is to use a layout program like Publisher or InDesign.

  • What are setup tables and why do you need to run it

    Hello Gurus,
    I know the steps for setting up the LO cockpit exactors.
    My question is what are the parameters that you feed into the Setup table filling screen --- like the doc numbers, start date and end date.
    Why do we have to run the setup tables?
    If I give the start date for setup table run for SD as 08/24/06 and end time Nill and others parameters blank, then would the set up job run for ever. Is this how you set it up in production environment.
    Does setup mean, bringing the data from application table to extraction structructure?
    Regards
    Simmi

    Hi,
    Look at the threads below :
    SetUp Tables
    setup tables
    setup tables
    setup tables
    Cheers,
    Kedar

  • Why do I need to run report RV80HGENu00A0to activate routine in QAS?

    Hi SD gurus,
    Every time I executed VL02N then click on post button I get an abap dump "CX_SY_DYN_CALL_ILLEGAL_FORM". I've learned that i have to run report RV80HGEN to activate the routine in QAS. My question is why do I have to run this report that I never ran in DEV? If you have SAP Notes it will be highly appreciated.
    Thanks and regards,
    Joel

    Hi Joel,
    The reply is already given for this.
    In development you dont need to run this because, when the program is created, the technical tables are automatically generated for usage. However when you  move this to the target system, you manually have to execute the program to activate these table entries for the routine.
    You can also include this program in the transport where the routine is saved. In this case, when the routine moves to the target system, the program automatically runs and the routine will be generated in the target system.

  • Why do i have to manually fwd songs on my nanao

    why do i have to manualy forward songs on my nano

    You can delete songs from your iTunes/computer hard drive after transferring them to the iPod, and for this you need to set your iPod to manage the songs manually.
    However, this is an extremely risky option because when (and not if) there comes a time to restore your iPod, which is a very common fix for iPod problems, then all the music would be erased. If you no longer have the music in iTunes (or any other back up), then all that music would be lost.
    What if the iPod were lost/stolen/needed repair? Again, the music would lost. I strongly recommend a back up, and if computer hard drive space is in short supply, you should seriously consider an external hard drive. They are not expensive, and the cost is well worth it when compared to the loss of all your precious music.
    At the very least back up your music to either cd or dvd before deleting it, particularly any purchased music/videos, as this would have to be bought again if it were lost. See this.
    Backing up your media in iTunes.
    Please excuse the sermon, but we see far too many people lose their music because of no back up.

  • Why is does my apple run SLOW.you go to open a program and the circle thing just spins for a delayed period of time.  You change from typing in a word doc and go to say email or internet and it takes several minutes to allow you open anything up.  Like it

    Why is does my apple run SLOW.you go to open a program and the circle thing just spins for a delayed period of time.  You change from typing in a word doc and go to say email or internet and it takes several minutes to allow you open anything up.  Like it is frozen.  I have tried rebooting the computer and it works for a few minutes then gets stuck.

    Which model iMac do you have?
    How large is your HD and how much space do you have left?
    Check out the following & do the necessary: 
    User Tip:  Why is my computer slow?
    What to do when your computer is too slow
    Speeding up your Mac
    OS X (10.6.6)
    Use Software Update or the OS 10.6.8 combo update to update your OS.  Also, update everything SU has to offer for your computer.  When done, repair permissions and restart your computer.

  • Why is my ipod so slow and laggy? i have lots of space on it, my history is deleted, i dont have multiple apps running! I have an iPod 4th Gen for about 2 years now and I don't know what to do.... Please help

    why is my ipod so slow and laggy? i have lots of space on it, my history is deleted, i dont have multiple apps running! I have an iPod 4th Gen for about 2 years now and I don't know what to do.... Please help

    Periodically double click the home button and close all the apps in the recently used dock. Then power off and then back on the iPod. This frees up memory. The 4G only has 256 MB of memory.
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar          

  • Vista x64, Dell Laptop Lately I have been getting audio ads from Lysol etc which I can stop by deleting the process plug-in container Iknow how to delete this process but why does the audio ad run despite the application of two well known antivirus progs?

    Vista x64, Dell Laptop Lately I have been getting audio ads from Lysol etc which I can stop by deleting the process plug-in container Iknow how to delete this process but why does the audio ad run despite the application of two well known antivirus progs?

    Oh, PLEASE IGNORE the line:
    deleted everything under HKLM\SYSTEM\CurrentControlSet\Enum\Root\SYSTEM (folders 0000 to 0004)
    That was left there inadvertedly. Can't seem to find the edit button here...

  • HT3625 I have a 2012 macBook Pro 13" and the option "Use audio port for" does not appear at all in the sound menu. why is this? im running  mountain Lion 10.8.2

    I have a 2012 macBook Pro 13" and the option "Use audio port for" does not appear at all in the sound menu. why is this? im running  mountain Lion 10.8.2

    Because line-in has been removed.
    It does allow for an Apple headset with mic., but I don't know if it would work with third-party ones.
    You'll need to use a Griffin iMic or similar to use line-in via a USB port.
    The same goes for the 15" retina, the newest MBA and the new iMac (whenever it finally arrives).

  • Why did I have to pay for pages for iPhone 5 running iOS 7?

    Why did I have to pay for pages for iPhone 5 running iOS 7?

    I thought the iWork suite was free for new devices running iOS 7...

Maybe you are looking for

  • HT5621 Want to change apple ID and password on 2nd Ipad to the one on my 1st Ipad.

    I have read the directions for how to set up an IPad but there is a problem.  I have 2 Ipads, one for work, and I set them up differently with different Apple IDs and passwords. Now I find out you can't buy extras for Apps you've already bought if yo

  • Artwork doesn't xfer to BlackBerry unless its a "Purchased AAC audio file"

    I've got a new BlackBerry Bold. I've had good success transfering my iTunes music to my phone, but I can only transfer album artwork for some of my songs. Only the songs in iTunes that are "Purchased AAC audio file" seem to successfuly transfer to my

  • Guys need some assistance!

    Hi.. before i purchased the nano i had previously had a ipod mini,the ipod mini came with a ipod udater which was "24/03/05", when it came to placing the nano updater on the comp i had loads of problems. 1)ipod would not appear in the load up part of

  • Update 3.1.3 Vault backup takes an inordinate amount of time...

    Installed the update, 3.1.3. Now clicking Vault icon to update the Vault, the update takes an inordinate amount of time. In addition after the update the Vault icon, lower left, remains red. Normal Vault update goes to the server, prior to the update

  • How to determine which chipset my Satellite L300/700 has?

    I have a SATELLITE L300/700 (PSLB8A-047004). The User Guide covers several models. It indicates that the chipset determines which memory modules I need for a memory upgrade. How do I find out which chipset I have, please? Kev.