PdDoc.Save()

I am having trouble saving a pdf. I'm using the SDK in C#. My project just grabs a bunch of pdf files and merges them.
I have added a COM reference to Acrobat.
I open the first one manually using avDoc, then with pdDoc.
Then I loop through the rest of the files and append them to the first doc.
After I am done merging, I try to save by using pdDoc.Save(), but for the first argument nType, I can't get any value to work in there. I tried putting PDSaveFull, but that didn't show up in intellisense and it gave me an error, then i tried to put 1, but that just returned false.
Am I missing some other reference? Or am I just doing something completely wrong?

After playing around with it more, I got it. Thanks =)

Similar Messages

  • How to tell PDDoc.Save() to use CombatibillityLevel 1.4?

    My application is using OLE to open PDF Files in Acrobat 9 and store them optimized for fast web access, again. Unfortunately, Acrobat stores the files as PDF 1.7 even if they were PDF 1.4 before.
    Is there any possibility to tell Arcrobat 9 to use PDF 1.4 (no matter if generall configuration or OLE command)?
    I´ve already tried to set the compabillty level in the distiller configuration but it seems, that PDDoc.Save always ignores these configurations.

    ok, thank you very much. It seems I have to look for a third party tool to convert my PDFs to PDFs with fast web access enabled. Just one last question: Is there a way to configure my Acrobat Installation to always save any pdf in PDF Version 1.4 (like the CombatibillityLevel Setting in Distiller)?

  • PDDoc Save Problem

    I have a script written in VBA (Outlook 2003, Win XP, Acrobat 9) that works on one machine but not another. The problematic part is the PDDoc.Save with which I'm saving the file to a new path and filename.
    When it doesn't work the PDDoc.Save returns True as if it DID save but no PDF is produced and the name of the open PDF doesn't change.
    Again, this works on one machine but not another and I've been unable to figure out what the difference.
    Any ideas?
    Thanks!
    Ken

    I've posted the question to the SDK forum, though I'm not sure why this would fall under the guise of the SDK and not just scripting.
    I mentioned in the initial post that the Acrobat version is 9, 9.4.3 to be exact, on both machines. I've also since tested it on a third machine and, again, it worked just fine.
    The code is pretty straight forward:
        Set AcroAVDoc = Acro.GetActiveDoc
        Set AcroPDDoc = AcroAVDoc.GetPDDoc
        WasSaved = AcroPDDoc.Save(AcroSave.WebOptimized, CheckPath$ & PDFName$)
    I've double and triple checked all the parameters and they're correct when the PDDoc.Save is executed so I'm at a loss as to why it's not actually doing anything.
    Is there some sort of setting in Acrobat that might be preventing the scripting from saving the file?
    Thanks again

  • PDDoc.Save doesn't save on 1st (and sometimes 2nd, 3rd, 4th etc...) try, but saves eventually

    Basically, I have a List of files to import to my C# program from a directory.
    The C# program opens the files in Acrobat X, runs a plugin on them, and once the plug in has completed, it saves the files to another location.
    AcroAppClass mApp = new AcroAppClass();
    AcroAVDocClass avDoc = new AcroAVDocClass();
    AcroPDDoc pdDoc = new AcroPDDoc();
    if (avDoc.Open(fileToOpen, ""))
        pdDoc = (AcroPDDoc)avDoc.GetPDDoc();
        mApp.MenuItemExeute("My plugin name");
        bool saved = false;
        while(!saved)
            pdDoc.Save((short)(PDSaveFlags.PDSaveFull | PDSaveFlags.PDSaveCopy | PDSaveFlags.PDSaveLinearized | PDSaveFlags.PDSaveCollectGarbage), saveFileName);
            if(File.Exists(saveFileName)
               saved = true;
           else
               Console.WriteLine("Save failed");
    The while(!saved) loop runs anywhere from 1 to x times. x has been has high as 10 times, or as low as 2, but never 1.
    Why may this be?
    I have full Administrative access to the drive, the files and the folders. The INTERESTING point is that eventually, after executing the PDDoc.Save command multiple times,
    the file does end up saving, but this can't be correct operation, right?

    BarlaeDC, the plugin edits the annotations in the document to update the links to URI annotations instead of standard Launch annotations.
    Is there a way to get a report back from my plugin to my calling application so that it knows when the plugin is completed doing its job?
    Bernd, application requirements by the client do not permit saving through the plugin. They want the C# code called through even another program, and need the C# to report back to it about the save.

  • About the validity of CosObj after PDDoc save

    I know that a CosObj will be invalid after PDDoc save with linearize or full save.
    But I'm not sure that CosObj is still valid after save with increment.
    By now I use the CosObj after increment save is OK,i just want to confirm that this is OK.
    Any advice?
    Thanks.

    lrosenth wrote:
    You are removing the CosObj from an Array and then saving the changes incrementally.  That means that the object is still in the PDF but "unattached" to anything (I am assuming) so it is now marked as free in the xref.
    BUT then you want to reattach it back to the same array?   Are you going to save again?  Don't understand the workflow involved....
    Yes, you are right. I want to reattach it back to the same array.Only one precondition:not want to create a new CosObj.
    After that, save again.

  • How to save as "optimized" using IAC

    Dear all,
    I am trying to programmatically batch reduce the size of PDFs. Manually, I would go through File>Save as>Adobe PDF files, optimized. From reading the documenation I was expecting that I could achieve the same using (C# and IAC):
    pdDoc.Save((short)Acrobat.PDSaveFlags.PDSaveLinearized, newName);
    However, this doesn't reduce the size of the file at all. Could anyone point me in the right direction?
    Kind regards,
    Martin

    I tried this:
    Dim outDoc As CAcroPDDoc
    Dim App As CAcroApp
    Dim inDoc As CAcroPDDoc
    Dim outputFileFullPath As String
    Dim inputFileName As String
    Dim i As Integer
    'Dim fileNames(PDFfiles.Count - 1) As String
    Dim xmlFileName As String
    Dim w As String, x As String, y As String, z As String
    Dim numInPages As Integer, numOutPages
    Dim retval As Integer
    Dim tempFileName As String
    Dim xmlFile As String
    Dim processAcrobat() As Process
    Dim trialAttempts As Integer = 6
    Dim triedAttempts As Integer
    Dim finishedOptimization As Boolean
    Dim killedAcrobat As Boolean
    Dim BRetval As Boolean = False
    Dim AcrobatJava As Object
    'Dim pp As VariantType
    'For i = 0 To PDFfiles.Count - 1
    ' fileNames(i) = PDFfiles(i)
    'Next i
    If PDFfiles.Count = 0 Then
    'FileSet.LogMessage("No files were found for this set. Output File was going to be " & outputFileName)
    Exit Function
    End If
    tempFileName = Path.Combine(outputDir, "temp.pdf")
    If PDFfiles.Count > 1 Then
    Try
    'outDoc.New(outputFileFullPath)
    outDoc = CreateObject("AcroExch.PDDoc")
    App = CreateObject("AcroExch.App")
    App.Hide()
    'outDoc.Open(outputFileName)
    File.Copy(PDFfiles(0), PDFfiles(0) + ".tmp", True)
    outDoc.Open(PDFfiles(0) + ".tmp")
    For i = 1 To PDFfiles.Count - 1
    inDoc = CreateObject("AcroExch.PDDoc")
    inputFileName = PDFfiles(i)
    retval = inDoc.Open(inputFileName)
    'outDoc.Attach(inDoc)
    'outDoc.InputCopyAll()
    numOutPages = outDoc.GetNumPages() - 1
    numInPages = inDoc.GetNumPages()
    retval = outDoc.InsertPages(numOutPages, inDoc, 0, numInPages, -1)
    numOutPages = outDoc.GetNumPages()
    inDoc.Close()
    inDoc = Nothing
    'File.Copy(inputFileName, outputDir & "/" & CStr(i) & ".pdf")
    Next i
    'outDoc.Close()
    AcrobatJava = outDoc.GetJSObject()
    App.Hide()
    Dim pp As Object = AcrobatJava.getPrintParams()
    pp.fileName = "file://c/ftp_stream/example/myDoc.ps"
    pp.printerName = ""
    AcrobatJava.print(pp)
    'App.Show()
    'App = Nothing
    AcrobatJava = Nothing
    outDoc.Save(Acrobat.PDSaveFlags.PDSaveFull + Acrobat.PDSaveFlags.PDSaveCollectGarbage + Acrobat.PDSaveFlags.PDSaveLinearized, Path.Combine(outputDir, outputFileName)) 'Path.Combine(outputDir, "final.pdf"))
    outDoc.Close()
    outDoc = Nothing
    BRetval = True
    Catch ex As Exception
    'FileSet.LogMessage("Error Message 1007: Error concatenating Pdf Files for inputfile " & inputFileName & " OutputFile=" & outputFileName & " Error is " & Err.Description)
    BRetval = False
    Finally
    outDoc = Nothing
    Do Until killedAcrobat Or triedAttempts = trialAttempts
    Try
    processAcrobat = System.Diagnostics.Process.GetProcessesByName("Acrobat")
    For i = 0 To processAcrobat.GetLength(0) - 1
    processAcrobat(i).Kill()
    Next
    triedAttempts = triedAttempts + 1
    If File.Exists(inputFileName + ".temp") Then
    File.Delete(inputFileName + ".temp")
    System.Threading.Thread.Sleep(1000)
    End If
    killedAcrobat = True
    Catch exException As Exception
    killedAcrobat = False
    End Try
    Loop
    End Try
    Else
    File.Copy(PDFfiles(0), outputFileName, True)
    End If
    When I get to "getPrintParams" it pops up a dialogue window. How do I get it to not do that?

  • Can't get PDDoc.CropPages to work in vbs

    Acrobat professional 9
    Visual Basic Script
    See code below.
    Both pddoc.CropPages and pddoc.Save return true. A new file is created (saved) but nothing gets cropped.
    What am I doing wrong?
    Help wanted.
    Best regards
    Roger
    Set pddoc = CreateObject("AcroExch.PDDoc")
    pddoc.open ("c:\theFile.pdf")
    Set rect = CreateObject("AcroExch.Rect")
    rect.top = 100
    rect.left = 100
    rect.bottom = 500
    rect.right = 600
    WScript.Echo pddoc.CropPages (0, 1, 0, rect)
    WScript.Echo pddoc.Save (1, "c:\theCroppedFile.pdf")
    pddoc.close
    Set pddoc = Nothing
    Set rect = Nothing

    I´ve tried a few different PDFs and all have failed.
    I think the values are correct.

  • Help with Batch Labeler (extremely Urgent)

    Good Afternoon Eeveryone,
    I am in need of help to create a Batch file to stamp the filename of the PDF document in the document itself.
    This is for audit and control purposes.
    i have the following javascript to add the filename as a header.
    app.addSubMenu({ cName: "Header",cUser: "Set/Remove Header", cParent: "File", nPos: 20 });
    app.addMenuItem({ cName: "(Filename)", cParent: "Header", cExec: "SetHeader(1)"});
    app.addMenuItem({ cName: "-------------------------------", cParent: "Header",cExec: "{}"});
    app.addMenuItem({ cName: "(Filename)", cParent: "Header", cExec: "RemoveHeader(1)"});
    //Set/remove Header
    function SetHeader(ARG)
    var re = /.*\/|\.pdf$/ig;
    var FileNM = this.path.replace(re,"")+".pdf";
    var Path = this.path;
    var AcDate = new Date();
    var AcDateFormat = "yyyy/mmm/dd  HH:MM"
    var Box2Width = 50
    for (var p = 0; p < 1; p++)
      var aRect = this.getPageBox("Crop",p);
      var TotWidth = aRect[2] - aRect[0]
      if (ARG<=3 || ARG==9)
       { var fd = this.addField("xftDate", "text", p, [20,1600, TotWidth-30-30,30]);
          fd.value = "Nº:" + FileNM;
           fd.textSize=12; fd.readonly = true;
           if (ARG==1){ fd.alignment="left" };
           if (ARG==2){ fd.alignment="center" };
           if (ARG==3){ fd.alignment="right" };
      if (ARG==4 || ARG==5 ||ARG==9)
       {  var hStart=(TotWidth/2)-(Box2Width/2)
           var hEnd=((TotWidth/2)+(Box2Width/2))
           if (ARG==5){var hStart=(TotWidth-Box2Width-30); var hEnd=(TotWidth-30);}
           var fp = this.addField(String("xftPage"+p+1), "text", p, [hStart,30,hEnd,1450]);
           fp.value = "Page: " + String(p+1)+ "/" + this.numPages;
           fp.textSize=12;  fp.readonly = true;
           fp.alignment="center";
    function RemoveHeader(ARG)
    if (ARG<=3 || ARG==9) {var x = this.removeField("xftDate");}
    if (ARG==4 || ARG==9)
       {  for (var p = 0; p < this.numPages; p++)
          {var x = this.removeField(String("xftPage"+p+1)); }
    I found this on another Thread and made some changes to suit my needs, now i need this to reproduce to a large ammount of pdf files, and that works with adobe reader.
    i have this batch file that i also took from another thread, if i click on it it works fine, i change the directory where it sends the files but when i drop a file on it it gives a error saying it cant "create object acroexch.app"
    '//////  User settings /////////////////////////////////////////////////////////
    fileSaveDir = "c:\Temp"    '/->state an existing folder for saving changed files
    mode = 1         '/->  0=work hidden; 1= show acrobat
    test = 1             '/-> 0= don't show messages; 1=show messages
    '    // set WSH objects
    set oWsh = CreateObject ("Wscript.Shell")
    Set oArgs = WScript.Arguments
    Set fso = CreateObject("Scripting.FileSystemObject")
    '    // test basic files/folders
    if not fso.FolderExists(fileSaveDir) then : msgBox("Folder """ &fileSaveDir &""" don't exist") : wscript.quit : end if
    if oArgs.Count = 0 then :    MsgBox("Drag & Drop files on this") : Wscript.quit : end if
    '    // set acrobat basic objects
    Set App = CreateObject("Acroexch.app")
    if mode > 0 then app.show
    Set AVDoc = CreateObject("AcroExch.AVDoc")
    Set AForm = CreateObject("AFormAut.App") 'from AFormAPI
    '    // write  acro-js to a variable for later executing
    Ex = "  // set Date and filename as footer  "&vbLF _
      & "  var re = /.*\/|\.pdf$/ig;  "&vbLF _
      & "  var FileNM = this.path.replace(re,"""")+"".pdf"";  "&vbLF _
      & "  var AcDate = new Date();  "&vbLF _
      & "  var AcDateFormat = ""yyyy/mmm/dd  HH:MM"";  "&vbLF _
      & "  for (var p = 0; p < this.numPages; p++)   "&vbLF _
      & "  {   "&vbLF _
      & "    var aRect = this.getPageBox(""Crop"",p);  "&vbLF _
      & "    var TotWidth = aRect[2] - aRect[0];  "&vbLF _
      & "    var fd = this.addField(""xftDate"", ""text"", p, [30,15, TotWidth-30-30,30]);   "&vbLF _
      & "    fd.value =  util.printd(AcDateFormat, AcDate) + ""   ("" + FileNM +"")"";   "&vbLF _
      & "    fd.textSize=6;   "&vbLF _
      & "    fd.readonly = true;  "&vbLF _
      & "    fd.alignment=""left"";  "&vbLF _
    '    // kernel: batch processing of js-code
    for each xFile in oArgs
        if test = 1 then : OK = msgbox("Change file: " & xFile,1) : if OK = 2 then WScript.quit : end if
        If not fso.FileExists(xFile) Then : msgbox("File doesn't exist") : wscript.quit : end if
        If AVDoc.Open(xFile,"") Then
            set PDDoc = AVDoc.GetPDDoc
            AForm.Fields.ExecuteThisJavaScript Ex
            outFile = fileSaveDir &"\" &mid(xFile,InstrRev(xFile,"\")+1)
            if test = 1 then : OK = msgbox("Script executed"&vbCr&"SaveAs: "&outfile,1) : if OK = 2 then WScript.quit : end if
            If fso.FileExists(outFile) Then fso.DeleteFile(outfile)
            PDDoc.save 1, outFile
            App.CloseAllDocs
        else
            msgbox("Coudn't open file!") : wscript.quit
        end if
    next
    OK = msgbox("Batchjob finished!" &vbCr &"Close Acrobat?",1) : if OK = 1 then app.exit
    Set AVDoc = Nothing : Set PDDoc = Nothing
    Set APP = Nothing : Set AForm = Nothing

    thanks for all the replies, the documents are forms usage rights, the first javascript is running fine and dandy doing exactly what i want, all i need is something to run that javascript on multiple pdf at once.
    since this is for audit purposes i really could use this otherwise i would have to manually write over 400 document filename/numbers on eveyr piece of paper..
    =X

  • How to add text to a pdf file using Access VBA??

    I'm down on my hands and knees, begging.  I have 300 files that I want to put a variable string at the top of the first page (centered, or at the right hand side).  I am using Acrobat X and Microsoft Access 2010 and I do have the SDK and have spend over 10 hours so far searching it and the internet in general, for help and still am coming up empty handed. 
    I can do the looping and passing variables with my eyes closed, but I cannot get the syntax for the actual opening of the pdf and inserting the string. 
    I was trying to modify code I found yesterday that is supposed to add an annotation, but I don't want an annotation, I just want a string of text at the top of page 1. For now, all I want is to be successful at doing ONE file.  Can someone please give me a concrete example of the code I need to use?  Like I said, I'm in begging mode
    Public Sub AddText()
        Dim pdDoc As Acrobat.AcroPDDoc
        Dim page As Acrobat.AcroPDPage
        Dim annot As Acrobat.AcroPDAnnot
        Dim jso As Object
        Dim strPath As String
        Dim intpoint(1) As Integer
        Dim intpopupRect(3) As Integer
        Dim props As Object
        Set pdDoc = CreateObject("AcroExch.PDDoc")
        pdDoc.Open ("c:\Test\Test.pdf")
        Set page = pdDoc.AcquirePage(0)
        'Set annot = page.AddAnnot(0)
        intpoint(0) = 0
        intpoint(1) = page.GetSize.y
        intpopupRect(0) = 0
        intpopupRect(1) = page.GetSize.y - 100
        intpopupRect(2) = 200
        intpopupRect(3) = page.GetSize.y
        annot.SetColor (vbRed)
        annot.SetContents "JCPC - 22 - 2011050000001"
        pdDoc.Save 1, "c:\Test\Test.pdf"
        pdDoc.Close
        Set pdDoc = Nothing
        MsgBox "Done"
    End Sub

    You cannot skip arguments, you can either use the function with one
    argument (just the required argument), or you have to provide all of them.
    Also, it looks like you are trying to specify 20 parameters, even though
    the function only takes 19. Try the following:
    Call jso.addWaterMarkFromText("Test Text", jso.app.Constants.Align.Center,
    jso.Font.Helv, 16, _
        jso.Color.Black, 0, 0, True, True, True, _
        jso.app.Constants.Align.Center, jso.app.Constants.Align.Center, _
        100, 100, False, 1, False, 0, 1)
    I just typed this in without running it through the compiler, so there may
    be typos in the code, but you should get the idea of how the code is
    supposed to look like.
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    PDF Software Development, Training and More...
    [email protected]
    http://www.khkonsulting.com
    On Fri, Jul 26, 2013 at 1:55 PM, I Love Mustangs

  • Collab.showAnnotToolsWhenNoCollab = True Not Working in Acrobat 9

    I have a VB6 program that uses AcroExch.AVDoc.OpenInWindowEx to open a PDF document in our small app (similar to the ActiveViewVB sample). For Acrobat versions 7 and 8 we were able to enable the editing of comments (annotations) by getting the JSObject and executing:
    jso.collab.showAnnotToolsWhenNoCollab = True
    as documented in the SDK topic "Acrobat Interapplication Communication > Developing Applications Using Interapplication Communication > Using OLE > Using the JSObject interface > Working with annotations".
    In Acrobat 9 Pro running on WinXP SP3 when I single step that line in debug I go to the error handler for my Sub. Inspecting the VB Err object has Number = -2147417851 and Description = "Automation error
    The server threw an exception." I get a Microsoft crash notice about Acrobat a short while later.
    I've run a number of searches and haven't found any documentation indicating that you can't do this anymore. My app will be less useful if I can't do this. I've already logged this as a bug with Adobe but have no idea if they intend to fix it. Does anyone have any additional information or a work-around?

    Hello Everyone,
    I use the following VBS code, but to tell the truth, I don't know if it works or not. The main idea was to enable commenting from Adobe Reader. But after execution code, saving document and reopening it in Reader, commenting is still 'Not Allowed'. Is showAnnotToolsWhenNoCollab really capable to allow this and there is only error in my code? Or is the functionality different and this way can never be used for what I want?
    There is another issue that application is not closed on Exit, but is still shown.
    scriptPath = "C:\Acrobat\"
    Set gApp = CreateObject("AcroExch.App")  
    Set pdDoc = CreateObject("AcroExch.PDDoc")
    sampleFilePath = scriptPath & "AR_test_orig.pdf"
    pdDoc.Open sampleFilePath
    pdDoc.OpenAVDoc "myFile"
    gApp.Show
    Set formApp = CreateObject("AFormAut.App")
    'formApp.Fields.ExecuteThisJavascript "app.alert(""hello"");"
    formApp.Fields.ExecuteThisJavascript "Collab.showAnnotToolsWhenNoCollab = true;"
    Set formApp = Nothing
    pdDoc.Save 1, scriptPath & "AR_test.pdf"
    'pdDoc.Close
    gApp.CloseAllDocs
    gApp.Exit
    Set pdDoc = Nothing
    Set gApp = Nothing
    Thanks for any ideas.
    Jan
    PS: I use Acrobat 9.0 Pro

  • Opening files automatically in VBA and saving to PDF, Adobe Acrobat XI Pro

    Hello,
    I have Adobe Acrobat XI Pro and I want to ask if there is any possibility to open automatically files in Adobe by VBA (Word files, Excel, etc.) and save them to PDF?  Or maybe it is a possibility to print them with Adobe PDF Printer?  If there is something like that can you give me a sample of code?
    Thank for your help.
    Best regards,
    Robert

    Thank you for your advices.
    I already download Acrobat SDK before, but it's really complicated for someone who know only VBA at intermediate level.
    I really plan to learn javascripts and COM in future, but I was thinking that if I ask you for I guess easy think (opening files and saving them to pdf) you will help by giving similar code or some clues.
    Anyway I found  this two methods in documentation: PDDoc.Save and PDDoc.Open and I believe that a combination of them can finally help me. Do you know how I can connect them to one part?

  • Scanning with Acrobat 9

    I am having some strange problems with an application after an upgrade from Acrobat Pro 5 to Acrobat Pro 9. What the application is supposed to do is to scan a document to PDF, save it to some temporary location, display it on the screen and later save it to the database. For scanning, I am using the MenuItemExecute("scan") method of the Acrobat application object (I don't think there is any other way!). The scanning is triggered by a button on the application's form, and the scanned document is displayed also on the application's form using the OpenInWindowEx method of AcroAVDoc. Acrobat's window is kept hidden.
    In the past, clicking on the "Scan" button would open the settings dialog of the scanner's TWAIN driver, and the result of the scanning would get displayed properly without any trace of Acrobat running behind the scenes. With Acrobat 9, however, the Acrobat window gets displayed; the scanned image first appears inside it and a second later gets transferred to my form. That would not have been so bad (I call the Hide method of AcroApp immediately afterwards to make Acrobat disappear), but the problem is, it works terribly unreliably.
    On one scanning attempt out of ten, the Acrobat would appear minimized in the task bar and only the scanning dialog will be displayed (the Acrobat's internal dialog, not the TWAIN driver's). Then after the scanning, the application would crash when trying to call GetActiveDoc() of AcroApp or GetPDDoc() of AcroAVDoc. The error message is meaningless: something like "Cannot call method '~' of object '~'". On other occasions the scanned page would appear in the Acrobat's own window and stay there without being transferred to the application's form. It's just crazy.
    Is there some trick with scanning from the new Acrobat that I am not aware of? Everything seems to be very unstable with the new version. Thanks in advance!
     

    We had a VBScript that used IAC for Acrobat 7 to scan to a file of specified name, that died under 9. I think the change was really a result of changing from MDI to SDI under Acrobat 8.
    Anyway, our tweaked VBScript function that now works under 9 looks like this (yeah, we leave Acrobat visible, but perhaps you'll see something here) ...
        function AcrobatScanToFile(outputFullPath)
        'Launch Acrobat to scan a document to a specific path
            const MAXIMIZE_ACROBAT = 1 ' 1-yes; 0-no
            dim success
            success = True
            dim ScanOK
            dim app
            set app = createobject("AcroExch.App")
            ScanOK = app.MenuItemExecute("Scan")
            dim AVDoc
            set AVDoc = createobject("AcroExch.AVDoc")
            set AVDoc = app.GetActiveDoc
            if AVDoc.IsValid then
                dim PDDoc
                set PDDoc = createobject("AcroExch.PDDoc")
                set PDDoc = AvDoc.GetPDDoc
                if PDDoc.Save(1,outputFullPath) <> True then
                    success = False
                end if
                PDDoc.Close
            else
                success = False
            end if
            if success then
                AVDoc.BringToFront
                AVDoc.Maximize MAXIMIZE_ACROBAT
            end if
            'AVDoc.Close 0
            'app.Exit
            AcrobatScanTofile = success
        end function

  • Simple calculations not working in acrobat 9

    I have text form fields made in Acrobat 9 from a previously made pdf, where I need a simple calculation, but I cannot get it to work.
    The form is not for submission, only for personal tracking, so I don't even need validation.
    FieldA (a number they enter) x a number I have entered in the calculation = FieldB
    FieldB x FieldC (a number they enter) = FieldD In FieldB I have a simple javascript Calculation in the form field: FieldA * .115, which should automatically calculate answer into FieldB, when tabbed.
    In FieldD I have a Calculation in the form field: FieldB * FieldC, which should automatically calculate answer into FieldD. All fields are set as numbers.
    I have left the Trigger Action as Mouse Up.
    I don't need to validate, as this is personal use, and is not being submitted.
    I have all fields in the correct tab order.
    I have reader enabled the form. When I open the form in Reader, I can enter the numbers, but no calculations are being performed. It reads 0 in FieldB and FieldD. Any assistance would be greatly appreciated.

    Hello Everyone,
    I use the following VBS code, but to tell the truth, I don't know if it works or not. The main idea was to enable commenting from Adobe Reader. But after execution code, saving document and reopening it in Reader, commenting is still 'Not Allowed'. Is showAnnotToolsWhenNoCollab really capable to allow this and there is only error in my code? Or is the functionality different and this way can never be used for what I want?
    There is another issue that application is not closed on Exit, but is still shown.
    scriptPath = "C:\Acrobat\"
    Set gApp = CreateObject("AcroExch.App")  
    Set pdDoc = CreateObject("AcroExch.PDDoc")
    sampleFilePath = scriptPath & "AR_test_orig.pdf"
    pdDoc.Open sampleFilePath
    pdDoc.OpenAVDoc "myFile"
    gApp.Show
    Set formApp = CreateObject("AFormAut.App")
    'formApp.Fields.ExecuteThisJavascript "app.alert(""hello"");"
    formApp.Fields.ExecuteThisJavascript "Collab.showAnnotToolsWhenNoCollab = true;"
    Set formApp = Nothing
    pdDoc.Save 1, scriptPath & "AR_test.pdf"
    'pdDoc.Close
    gApp.CloseAllDocs
    gApp.Exit
    Set pdDoc = Nothing
    Set gApp = Nothing
    Thanks for any ideas.
    Jan
    PS: I use Acrobat 9.0 Pro

  • Populate a PDF done with Adobe Livecycle Designer

    I have a pdf from an institution and I have been asked to populate it directly with data saved in an excel file. I have found that the pdf was done with adobe livecycle designer and with that program I can see the name of the fields in the form.
    The pdf can be found in:
    https://sedeelectronica.bde.es/f/websede/content/SPA/Form_TRA_clientes.pdf
    I have thought to use a VB macro in the excel file to populate the pdf. I have been searching on Internet but by now, I am only able to read the values of the fields, but I can't change them. I know that the code below doesn't work with XFA Forms, but I have read a lot of documentation and I can't find anything else.
    Here is the code:
    Set gApp = CreateObject("AcroExch.app")
    Set avDoc = CreateObject("AcroExch.AVDoc")
    If avDoc.Open(FileNm, "") Then
       Set pdDoc = avDoc.GetPDDoc()
       Set jso = pdDoc.GetJSObject()
    jso.Getfield("FrmSolicitudTransferenciaEuros[0].FormContent[0].ordena nte[0].datosOrdenanteExterno[0].ordenante[0]").Value  = "new value"
        pdDoc.Save 1, FileNm
        pdDoc.Close
    End If
    avDoc.Close (True)
    Can anybody write an example explaining how to do that with XFA?
    Thank you in advance.

    You might want to instead use an XML schema to map cells in your Excel spreadsheet to fields in your form. Then you would just export the XML data from your spreadsheet and import it into your form to populate the fields.
    That should get you started. Refer to Excel and LiveCycle Designer documentation for further details.
    Kyle

  • Acrobat Pro 9 IAC Detect Corrupt File (TIFF)

    I am trying to convert a huge number of tif files into pdf files, and most of the time the code below works fine, using the IAC to control Acrobat.
    try
    CAcroAVDoc avDoc = new AcroAVDocClass();
    avDoc.Open(@"D:\Bad Files\file1.TIF", "");
    CAcroPDDoc pdDoc = (CAcroPDDoc)avDoc.GetPDDoc();
    pdDoc.Save(3, @"D:\Bad Files\file1.pdf");
    avDoc.Close(1);
    catch (Exception ex)
    MessageBox.Show("Caught!");
    But we seem to have a certain amount of corrupt tif files that occur every now and then which are causing a problem. When the avDoc.Open line runs, there is a popup error message that says.
    "Acrobat could not open 'file1.TIF' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)."
    There is no exception thrown, so the program hangs while it waits for someone to click OK on the message. Is there any way to disable this popup so that the program can continue? I'm not bothered about it throwing an exception, because the pdDoc.Save throws one anyway if the file didn't open successfully.
    I have seen a conversation on a forum somewhere suggesting that we should not use the CAcroAVDoc class, we should just use "PDDoc.Open" instead, but PDDoc doesn't seem to exist. I tried using CAcroPDDoc but as far as I can see it can only be instantiated by the instance of CAcroAVDoc and it doesn't have any static methods on it.
    We are using Adobe Acrobat Professional version 9.

    Post your question in the 'Acrobat Developers SDK' forum.

Maybe you are looking for

  • Help, cant view video

    ok, i visit a site that has a video section. i have always managed to watch videos on it until we had an update for itunes. since then i cant watch the videos. we did a system restore to before the itunes update and all was well again but however, it

  • How to set column names in OVS search help of ALV EDIT

    Hi All, I have a OVS search help for my ALV EDIT column.This OVS will have two columns,I need to give the names(name1 , name2)  to the columns. I am writing the below codo in phase 0.       ls_text-name = 'Column1'.       ls_text-value = 'name1'.    

  • Satellite L30: Usb device not is recognized

    I have a problem with my L30 laptop. When I'm connecting my phone or usb stick or external hdd it says: Usb device not recognized one of usb devices has malfunctioned. Tried to reinstall windows didn't help... is there any solution?

  • IOS 5 on a powerbook G4. Running OS 10.5.8 as well as iTunes 10.5. I do not have USB 2.0 (1.1). Can I stillget iOS 5?

    I have an old Powerbook G4 and it is running on OS 10.5.8. I just downloaded iTunes 10.5. My questions is; Will I be able to download to iOS 5? The USB connection is the old 1.1, would that have anything to do with being able to get iOS 5? Also, I pu

  • Where are Bex-web favorits and Bex portfolio stored

    At the moment we use the portal and I views to execute queries. After executing you can add your own filters, drag and drop object, key figures, etc......... SAP offers to save this variant as a Bex-portfolio(available for all users) or favorit(avail