Quantcast
Channel: Adobe Community : All Content - Acrobat SDK
Viewing all 2571 articles
Browse latest View live

Calling AVPageViewGoTo from another thread

$
0
0

Hello,

 

I would like to synchronize external events (from a WebSocket) and the advancement of my presentation in Acrobat.

I'd like to use the AVPageViewGoTo function when I get an event from this WebSocket.

Therefore, I created a C++ class  handling my WebSocket connection. In this class, I have a method binding the WebSocket's events to a function passed as a parameter.

 

In my plugin, I have a function ("GoToPage") which looks like this:

void GoToPage(int pageNumber)

{

AVPageView page = AVDocGetPageView(AVAppGetActiveDoc());

AVPageViewGoTo(page,pageNumber - 1);

}

I pass it as a parameter (as a std::function<void(int)>) to my WebSocket client.

 

My problem is that whenever the "AVPageViewGoTo(page,pageNumber - 1);" line is called from the client, my plugin crashes and I have an access read violation (even if page is not null).

 

I guess that this problem is due to the fact that I try to call a function of Adobe Acrobat's API outside the main thread (as explained here https://forums.adobe.com/thread/1432181). Is this correct?

 

If that is the case, can I create a handler as explained in the documentation to achieve my initial goal? And if so, may I get a bit more information on the topic?

 

Thanks in advance for your answers.


PDF to HTML Conversion with Interapplication Communication Api in Mac OS

$
0
0

I'm trying to convert a PDF file via the Interapplication Communication API of Adobe Acrobat using Adobe Acrobat Pro DC 2017.009.20058 Trial Version.

My script doesn't appear to be converting my file from PDF to HTML.  It works for some formats (e.g. plain-text), but not for others (e.g. spreadsheet, xlsx).  Perhaps it is because I'm using the trial version?   Here is my AppleScript code:

 

 

setmyfileto "/PATH/pdf_schedule.pdf"

setoutfileto ("PATH:pdf_schedule.html" astext)

 

tellapplication "Adobe Acrobat"

  -- get every conversion

  activate

  openmyfile

  savedocument 1 tofileoutfileusingconversion "com.adobe.acrobat.html"

  closedocument 1

endtell

 

 

And `get every conversion` returns this (with html highlighted in blue):

 

{EPS Conversion "com.adobe.acrobat.eps" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.xlsx" ofapplication"Adobe Acrobat",conversion "com.adobe.acrobat.html" of application "Adobe Acrobat", conversion "com.adobe.acrobat.jpeg" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.jp2k" ofapplication "Adobe Acrobat", conversion"com.callas.preflight.pdfa" ofapplication "Adobe Acrobat", conversion "com.callas.preflight.pdfe" ofapplication "Adobe Acrobat", conversion "com.callas.preflight.pdfx" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.png" ofapplication "Adobe Acrobat", PostScript Conversion "com.adobe.acrobat.ps" ofapplication "Adobe Acrobat", conversion"com.adobe.acrobat.pptx" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.rtf" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.accesstext" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.plain-text" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.tiff" ofapplication "Adobe Acrobat", conversion"com.adobe.acrobat.doc" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.docx" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.xml-1-00" ofapplication "Adobe Acrobat", conversion"com.adobe.acrobat.spreadsheet" ofapplication "Adobe Acrobat"}

C#: convert a PDF file to a text file using Acrobat

$
0
0

I am writing a C# application that needs to use Adobe Acrobat DC to open a PDF file and save it as a text file, using Acrobat's file conversion. How do I do this? Can anybody show me some sample code using the SDK? I have already looked through the sample code provided with the SDK but I don't see anything that helps me convert a PDF file to a .txt file.

How to convert tables and

$
0
0

We need to get specific data from tables from PDF-files, is there any way to convert all tables in the copiable PDF-files to processable and formated tables(doc/xls/etc.) by patch ways.

Many Thanks! !

Send and track for Outlook stopped working?

$
0
0

2015-07-03 Send and track for Outlook worked perfect. Today (same environment, no changes made by me or system administrator) I just get a message (in Swedish) "This Adobe ID can not be found. Open Acrobat and log in with your Adobe ID". Wich I did. Several times. Also closed Outlook inbetween and so on. Sad that this excellent service from within Outlook (that MS failed to offer, despite all kind of "professional" Sharepoint services) stopped working so soon. Is there anything I can do to restore the function?

Is there APIs available in Acrobat for extracting text from images using C#

$
0
0

Is there APIs available in Acrobat for extracting text from images using  C#

Acrobat Javascript Interface, add Image, save as PDF/X1a

$
0
0

I need to be able to add and place one or more TIF images into a page in a PDF and save it as PDF/X1a.  I am using Acrobat DC and the JavaScript interface right now.

 

I have tried successfully creating a Button field where the image should go, and then use importIcon() to import the image, and buttonSetIcon() to insert it into the field.  But, I don't want a button field in the PDF.

 

I have also successfully tried using addWatermarkFromFile which works great with one problem: The image has a transparency property and because of that I can't export to PDF/X1a.

 

Any help is appreciated.

C# Encrypt existing PDF using a Certificate

$
0
0

Hi all,

 

I am creating a component for a server based application where we take an existing PDF and want to apply encryption.

 

The certificate used to apply the encryption can be identified but I need help which Adobe component to be used best and which calls to be used best in a C# .NET 4.0 server application.

 

All users have Adobe Acrobat Standard installed on their machines.

 

Thanks

Daniel


How to apply digital signature in abdobe acrobat using RSA Algorithm?

$
0
0

I want to apply digital signature in  a PDF with abdobe acrobat using RSA Algorithm. I need to verify the signature in it by a public key pair of the private key with which signature was set   in c# to the PDF.

Application crash when using ActiveX control (C++ and C#/.net projects)

$
0
0

I've been debugging a crash in an application which appears to stem from the Acrobat Reader ActiveX components, when Acrobat Reader DC 2017 is installed on the computer. The application is a native Windows application written in C++, but I cannot easily create a sample project for it (inherited code base, not my forte), but I'm getting the same error (Structured Exception) from a simple test/repro project made in C#.

 

In this specific crash instance, it appears that the key step is performing any key press operation, within the control, after loading a document. This brings up the special tools in the right-hand side of the viewer's control area.

 

The sample C# repro project can be downloaded here: Dropbox - AcrobatReaderCrash.zip , and the steps to reproduce from it are as follows:

 

  1. Start the application, with or without debugging enabled
  2. Click on either of the "Load" buttons, at least once, up to however many you'd like
  3. Click within the viewer
  4. Press the "Esc" key
  5. Click the load buttons again, if you'd like. This part doesn't make a different
  6. Click the "Exit" button (or "X" in the Windows bar, Alt+F4, System menu + "Close", etc)
  7. Exception is raised and application crashes.

 

To the best of my diagnosing abilities, but don't take my word as the final authority on it, what appears to be happening is that a component created or referenced within the ActiveX control is getting double-freed, thus causing the "NullReferenceException" in the .net code, and the "ACCESS_VIOLATION" SEH from "native" code.

 

Is there any call which should be made prior to closing or disposing of the control? Or perhaps some property that can be set to prevent the command bar from being displayed (it can also be activated by clicking the "Acrobat" triangle logo which appears in the floating bar with page numbers, etc, in the viewer).

PDEElementGetBBox returns different value

$
0
0

Hi.


I have developed a plugin which delete the text element from PDF.
In some cases, the value obtained from PDEElementGetBBox return the different value from two text element

at same position within PDDoc objects(objectA and objectB).

 

objectA makes from objectB.

 

     const PDDoc objectA = PDDocCreate();
     PDDocCreatePage( objectA, PDBeforeFirstPage, srcrect );
     PDDocReplacePages( objectA, 0, objectB, pagenum, 1, false, NULL, NULL, NULL, NULL );

 

I Used PDEElementGetBBox to same position text element within objectA and objectB.
but return value(textBBox.left and textBBox.right) is different.

 

can you tell me reason about this case happened.

Acrobat SDK Export with CCITT

$
0
0

I have created an Acrobat Plugin using Visual Studio 2013 and C++.

 

In that plugin, I am doing the following:

  1. Create a new PDF document
  2. Use AVConversionConvertToPDF and PDEElementCopy to create a PDEImage ( I repeat for 2 images: a 1-bit monochrome TIF and an 8-bit grayscale TIF)
  3. Use PDEContentAddElem to add the images to a new document.
  4. Save document

 

The saved document has the 2 images with the proper values (bit depth, dimensions), except for 'Filters'.  The 1-bit monochrome image shows JBIG2 as a filter, but I want to use CCITT.

 

Can I change the compression for a PDEImage element before I save the PDF file?

 

Note: I am not using PDEImageCreate because AVConversionConvertToPDF handles all types of image formats already.  The resulting PDF file is fine, except for the image's compression.

Need VB.Net help with detecting vertical text

$
0
0

I have a process that detects rotated pages and sets their orientation to 0 but I also need to detect vertical text on a page and act on that. In the test files I an using the page has not been rotated but the text (rasterized) is vertical. Using the Acrobat 11.0 object model through VB.NET, how can I achieve that? The following code does handle where the page has been rotated but does not detect the vertical text. Any help is appreciated.

 

    Private Sub cmdConvert_Click(sender As Object, e As EventArgs) Handles cmdConvert.Click

 

        Dim AcroXApp As Acrobat.AcroApp

        Dim AcroXAVDoc As Acrobat.AcroAVDoc

        Dim AcroXPDPage As Acrobat.AcroPDPage

        Dim AcroXPDDoc As Acrobat.AcroPDDoc

        Dim JSO As Object

 

        AcroXApp = CreateObject("AcroExch.App")

        AcroXApp.Hide()

        AcroXAVDoc = CreateObject("AcroExch.AVDoc")

        AcroXAVDoc.Open(txtTargetFile.Text, "")

        AcroXPDDoc = AcroXAVDoc.GetPDDoc

        JSO = AcroXPDDoc.GetJSObject

 

        Dim iPageCount = AcroXPDDoc.GetNumPages

 

        For i = 0 To iPageCount - 1

            Dim rotation = JSO.getPageRotation(i)

            Select Case rotation

                Case 90

                    AcroXPDPage = AcroXPDDoc.AcquirePage(i)

                    Debug.Print("Page " & i & " was set at " & rotation & " degree rotation")

                    AcroXPDPage.SetRotate(0)

                Case 180

                    AcroXPDPage = AcroXPDDoc.AcquirePage(i)

                    Debug.Print("Page " & i & " was set at " & rotation & " degree rotation")

                    AcroXPDPage.SetRotate(0)

                Case 270

                    AcroXPDPage = AcroXPDDoc.AcquirePage(i)

                    Debug.Print("Page " & i & " was set at " & rotation & " degree rotation")

                    AcroXPDPage.SetRotate(0)

            End Select

        Next

 

        Dim strOutFileName As String = Replace(txtTargetFile.Text, ".pdf", "_Rotated.pdf")

 

        JSO.SaveAs(strOutFileName)

        AcroXAVDoc.Close(False)

        AcroXApp.Exit()

        AcroXApp = Nothing

        AcroXAVDoc = Nothing

        AcroXPDDoc = Nothing

        JSO = Nothing

 

    End Sub

Is it possible to catch mouse click events?

$
0
0

Hello, I am tasked with looking for several professional libraries needed for product development in my company.

One of our planned product's core features requires click event handling within a PDF file, or the ability the detect bookmark/hyperlink click events. I can't seem to find any help about this specific issue, does anyone know if it's possible? And if it is, can it be done with natively with C#? Does it require a complicated workaround or JS event handling?

 

Thanks,

DK

Can javascript function "importTextData()" work in adobe reader?

$
0
0

I have created a javascript for loading some data into a text field from txt file. It can work in acrobat, but it does not work in adobe reader, can anybody take a look for me?  Thanks.

 

I create a folder level javascript file:
//**************
console.println("getID() initialize");

trustedgetID=app.trustedFunction(function getID()
{
app.beginPriv();    // Explicitly raise privilege
this.importTextData("testID.txt", 0)
app.endPriv();

})
//*****************

Then, I attach the following JS command to a button click event in pdf:
//************
trustedgetID();
//************

In acrobat, when I click the button, it load the data from testID.txt into the field in pdf, based on the column name. But, nothing happen when I do the same in adobe reader.

When I look into the SDK document, it seems that the importTextData() can work also in acrobat reader. Is there any other setting that I need to take care in adobe reader for runing such a script?


How to check a checkbox from vba?

$
0
0

Hi,

I am filling up PDF forms from Vba in Microsoft Access. Everything goes fine, except that I am unable to check checkboxes from my code.

My code is pretty simple, something like that :

 

Set field = jso.getField("checkboxfieldname")

field.Value = True

 

I tried everything I could think of: 1, "1", "On, "on", True, "checked", etc. Nothing seems to work.

I looked at the SDK: nothing on how to check checkboxes from vba in the documentation, nothing in examples either...

 

I'm sure the answer is simple :-)

Thanks for your help,

Patrick

plugin creation

$
0
0

Hi!

 

I am new to acrobat plugins.  I am having set of tools developed in acrobat java script like auto bookmarking.  I wanted to convert this into plugins using c++.  I dont know where to start and how to start.  Can any one help me on this?  How to create?  Which platform is required to create plugin?  How to create .api file?

 

Ariv

Hi, i want to add a button into a toolbar adobe with c++ , any help please

$
0
0

I've writted some code but it show me this erreur

 

(m_lpDispatch == NULL); : app.exe has trigged a breakpoint

 

but I think that I've do mistake into my code please really I need your help , I want to no how to step

"Combined supported files in Acrobat" as VBA script

$
0
0

Dear all,

Arcobat Pro has a very nice function as context menu "Combined supported files in Acrobat...". Does anyone have a sample code in VBA that I can use in Excel?

 

I want to perform the functions variably:

  • Specific files, which should be converted and merged into a single PDF
  • Specify which file comes first, second, or other place in the single PDF file
  • File name as bookmark
  • Optional: Edit Bookmarks from Excel cell data
  • Switch the File size
  • Optional: Switch Title and Author information
  • Optional: Save the single PDF in archiv format (PDF/A)

 

For an example VBA code I would be very grateful.

Best regards,

/M

PDF File Size Increase

$
0
0

We have encountered an issue where the size of the PDF files that we generate almost doubled in size when we upgraded the Operating System that we generate these files on from Windows XP to Windows 2012.  Has anybody else encountered this issue?  If so, how did you resolve it?

Viewing all 2571 articles
Browse latest View live