Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all 10848 articles
Browse latest View live

Re: Help editing rectangles in PDF using automation in vb.net

$
0
0

You'd need to start by getting a good familiarity with the PDF graphics model, the graphics chapter of the PDF specification. Then PDEdit starts to make sense. Ideally, you'd already know C/C++ because trying to learn that at the same time causes a great deal of pain.


Trouble with Info-Capture Application interfacing with pdf documents from Reader XI

$
0
0

Hello,

 

I have been working with a vendor to get this issue fixed but have had no success as of yet so I thought I'd reach out and see if anyone is in the same situation as I am with software trouble interfacing with Adobe Reader XI. We have an application called Proformance Info-Capture (v5.0) that we use to capture electronic signatures that sends documents into our Document management software. With Adobe Reader 11.0.13 installed (as this is what it is certified for) we can pull data from form fields right into info-capture and index the form based on the data generated in those fields without issue. However, if we update with the latest patches this communication is broken and our forms pull through without reading any of the data and need to be entered and indexed in the software manually. Proformance has not ben able to get to the bottom of it for us so i thought I would shoot this out there and see what happens. I am assuming it is on the info-Capture side of things that code isn;t working after some security hole is patched but I'm not sure. If anyone has anything worth looking at I'd appreciate suggestions.

Re: Extract highlighted words from a pdf (Acrobat SDK, OLE)

$
0
0

Here some code that will basically do what you want.

You may add the rest :-)

 

Enjoy, Reinhard

 

PS: It's written in VBS but can also used as VBA

 

FindWordAndMarkPermanent.vbs

 

'// Save this as xxx.vbs and start with Double Click
'// Acrobat must be opend before with an active document!! -otherwise error-

 

wordTF = "Reinhard" '//word to find
pdfText = ""

 

set WshShell = CreateObject ("Wscript.Shell")
WshShell.AppActivate("Adobe Acrobat")
WScript.Sleep 500

 

'// get the active Document
Set AcroApp = CreateObject("AcroExch.App")
Set AVDoc = AcroApp.GetActiveDoc
Set PDDoc = AVDoc.GetPDDoc
Set AForm = CreateObject("AFormAut.App") 'connect to Form API for later use

 

maxPages = PdDoc.GetNumPages
for p = 0 to maxPages - 1  '// start the page loop
   Set PdfPage = PDDoc.AcquirePage(p) '// p  = Pagenumber (zero based)
   Set PageHL = CreateObject("AcroExch.HiliteList")  '// created to get the page text
   PageHLRes = PageHL.Add(0,9000) '<<--SET in FILE! (Start,END[9000=All])
   Set PageSel = PdfPage.CreatePageHilite(PageHL)

 

   for i = 0 to PageSel.Getnumtext - 1   '// start the word loop on current page
     word = PageSel.getText(i)         '// get one word
     pdfText = pdfText & word         '// gather words on page

  

     if instr(word, wordTF) then       '// used instr because the "word" you may get as "word "
       msgbox("add:""" &word &"""")
       Set wordToHl = CreateObject("AcroExch.HiliteList") '// created to get the word on list
       wordToHl.Add i, 1 'Hilite the word Reinhard
       Set wordHl = PdfPage.CreateWordHilite(wordToHl)
       Set rect = wordHl.GetBoundingRect
       msgbox("left:" &rect.Left &" bot:" &rect.bottom &" right:"&rect.Right &" top:" &rect.Top)
       AVDoc.SetTextSelection(wordHl)  '// highlight the word (not really needed)
       AVDoc.ShowTextSelect()   '// show highlighted text (not really needed)
        '// write and execute js to mark permanent (to lazy to translate to jso)
       ex = " // set annot for text selection " &vbLf _
         & "var sqannot = this.addAnnot({type: ""Square"", page: 1, " &vbLf _
         & "rect: [" &rect.left &", "& rect.top &", " &rect.right &", " &rect.bottom &"], " &vbLf _
         & "name: ""p" &p &"i" &i &"""});"
       msgbox(ex)
       AForm.Fields.ExecuteThisJavaScript ex
    end if '// word found

  Next  '// get next word

  msgBox(pdfText)
  pdfText = ""
next '// get next page

 

msgbox("Done!")

PDF optimizer.

$
0
0

Does anyone know if the PDF Optimizer provided in Acrobat Pro XI can be called as an API from another application program? If the API exists where can it be obtained?

 

[Moved to Acrobat SDK forum... Mod]

Re: PDF optimizer.

$
0
0

It can be called from an Acrobat plugin.  You could write a plugin and also have that talk to your external application.

Re: Trouble with Info-Capture Application interfacing with pdf documents from Reader XI

$
0
0

We (Adobe) have no idea what Info-Capture is doing in their software – they are the only ones that can help here.  Sorry.

Re: Use PaperCapture API in .Net

$
0
0

Interop.acrobat .dll  is not functioning in 64 bit PC.Can any one suggest me

Interop.Acrobat.DLL is not working in 64 bit PC

$
0
0

Interop.Acrobat.DLL is not working in 64 bit PC


Receive filename from pdf file

$
0
0

Hello,

 

Can I get the filename without extension from an AvDoc object ?

Re: Receive filename from pdf file

$
0
0

You can get an ASPathname from the AVDoc and then there is an ASPathname API to get just the name (or you can get it as a platform path and do it yourself)

Re: Interop.Acrobat.DLL is not working in 64 bit PC

$
0
0

Do you mean that it isn’t working in a 64bit application?  That is because it is not a 64bit DLL.

Re: Export PDF to EXCEL in .net

$
0
0

Here is a stub. Put is inside your code and adjust hard coded parameters so that to pass them as function parameters.

 

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Net;

using System.IO;

using System.Runtime.InteropServices;

using System.Diagnostics;

using Acrobat;

 

 

        // Get a handle to an application window.

        [DllImport("USER32.DLL", CharSet = CharSet.Unicode)]

        public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

 

 

        // Activate an application window.

        [DllImport("USER32.DLL")]

        public static extern bool SetForegroundWindow(IntPtr hWnd);

 

 

        //Acrobat application as a private member variable of the class

        private CAcroApp mApp;

        private string AcrobateCaption = "Adobe Acrobat Pro DC";

        private string AcrobateName = "Acrobat";

        //private string AcrobateClass = "AcrobatSDIWindow";

 

        private void StartAcrobat()

        {

            //IAC objects

            CAcroPDDoc pdDoc;

            CAcroAVDoc avDoc;

 

 

            //constant, hard coding for a pdf to open, it can be changed when needed.

            String szPdfPathConst = "C:\\Temp\\cc.pdf";

            //string fileName = "C:\\Temp\\cc.xlsx";

            string fileName = "cc";

 

 

            //variables

            string szStr;

            string szName;

            int iNum = 0;

 

 

            int timeOut = 10000;

            int conversionTimeOut = 20000;

 

 

 

 

            Process[] allProcList = Process.GetProcesses();

 

 

            // Kill all Acrobats, which are already running

            Process[] processList = Process.GetProcessesByName(AcrobateName);

 

 

            for (int i = 0; i < processList.Length; i++)

            {

                bool kill = true;

 

 

                try

                {

                    // Try to close nicely

                    if (processList[i].CloseMainWindow())

                    {

                        if (processList[i].WaitForExit(timeOut))

                        {

                            kill = false;

                        }

                    }

                }

                catch (Exception)

                {

                }

 

 

                if (kill)

                {

                    try

                    {

                        processList[i].Kill();

                    }

                    catch (Exception)

                    {

                    }

                }

            }

 

 

            //Initialize Acrobat by creating App object

            mApp = new AcroAppClass();

            

 

 

            //Show Acrobat

            mApp.Show();

 

 

 

 

            //set AVDoc object

            avDoc = new AcroAVDocClass();

 

 

            //open the PDF

            if (avDoc.Open(szPdfPathConst, ""))

            {

                //set the pdDoc object and get some data

                pdDoc = (CAcroPDDoc)avDoc.GetPDDoc();

                iNum = pdDoc.GetNumPages();

                szName = pdDoc.GetFileName();

 

 

                //compose a message

                szStr = szName + " has been loaded in Acrobat by the IAC application.\n\n";

 

 

                if (iNum > 1)

                    szStr += "The PDF document has " + iNum + " pages.\n";

                else

                    szStr += "The PDF document has " + iNum + " page.\n";

 

 

                // Get a handle to the Acrobat application.

                IntPtr appHandle = FindWindow(null, AcrobateCaption);

 

 

                // Verify that Acrobat is a running process.

                if (appHandle == IntPtr.Zero)

                {

                    MessageBox.Show("Application is not running.");

                }

                else

                {

                    // Make Acrobat the foreground application and send it

                    // a set of commands.

                    SetForegroundWindow(appHandle);

                    SendKeys.SendWait("%(f)");

                    SendKeys.SendWait("t");

                    SendKeys.SendWait("s");

                    SendKeys.SendWait("~");

 

 

                    System.Threading.Thread.Sleep(timeOut);

                    SendKeys.SendWait(fileName);

                    SendKeys.SendWait("~");

 

 

                    System.Threading.Thread.Sleep(conversionTimeOut);

                    SendKeys.SendWait("^(q)");

                }

 

 

                MessageBox.Show(szStr);

            }

            else

            {

                MessageBox.Show("Cannot open " + szPdfPathConst);

            }

        }

Re: Export PDF to EXCEL in .net

$
0
0

Thanks for posting... but I'd recommend using an API instead. SendKeys and ThreadSleep doesn't seem a very robust method.

Re: Export PDF to EXCEL in .net

$
0
0

There is no API. That's why the hack. If you do find the API, please, post the code to call it here.

Re: Export PDF to EXCEL in .net

$
0
0

As reply#1 said, " you can use Acrobat’s bridge from .NET to JavaScript to do that." Never done it, but it seems practical.


Re: Export PDF to EXCEL in .net

$
0
0

Here are the comments:

1. "Never done it" == no solution.

2. Bridge has nothing to do with Acrobat Pro DC.

3. Unless I missed it, Acrobat Pro DC does not "expose" API interface for exporting to Excel (see Acrobat DC SDK Documentation) ==> there is no way to automate it via standard API calls.

4. If you have working code, please, post it here.

 

Thanks.

Re: Export PDF to EXCEL in .net

$
0
0

If the reference to "bridge to JavaScript" didn't make sense why didn't people say so a year ago...  I said I hadn't done it (and even if I had I wouldn't share code, ever, sorry). But I see discussions suggesting this can be and is done. This is nothing to do with the product Bridge. Nothing has been added to IAC for well over 10 years except for the one point noted below, and it isn't likely to happen now; developers are expected to bridge to JavaScript for any other functionality.

 

(a) Acrobat JavaScript appears to be able to do a saveAs to other formats, via cConvId.

(b) There is a VB:JavaScript interface allowing VB apps to run most JavaScript.

(c) It appears possible to use this interface (called a bridge) from .Net too.

Re: Export PDF to EXCEL in .net

$
0
0

#3 is incorrect.

 

Acrobat Pro DOES expose APIs for converting PDF to Excel.  These APIs are available to folks using the JavaScript programming model OR those using our Plugin development model.   We do not, however, expose them via the COM model.

 

However, as mentioned, you can use the FULLY DOCUMENTED and SUPPORTED COM->JS bridge to call JS methods.  Folks have been using this with VB and then .NET for close to 20 years now.

Re: PDF optimizer.

$
0
0

I should have been a little more detailed on what I need. We currently run a process that converts AFP's to PDF's. Some of the new PDF's are getting extremely large. I'd like to be able to add a step to the process to optimize/compress the document with minimal degradation in the image. I've used the save to WEB Mobile function in Acrobat Pro on one document and got the results I need. I'd like to integate the compression/optimization used in the IDE's save function but in my existing webservice. Do you know if the function is available as a Jar to be consumed in a java app, or as a stand alone API? 

Re: PDF optimizer.

$
0
0

Ah, I see…

 

If you are looking to do this from a service…then Adobe offers a server-side/on-prem component called AEM Forms which includes this capability (and admittedly a LOT of others).

 

We also have a Java Library that you can license from Datalogics, but it’s not as complete.

Viewing all 10848 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>