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

Getting the name of selected Node in Adobe 3D PDF

$
0
0

Hello,

I'm trying to use the following code to get the name of the selected node for a 3D object in my PDF.

/***************************************************************************************** ***************/

var c3d = this.getAnnots3D(this.pageNum)[0].context3D;

c3d.activated = true;

var select = c3d.scene.selectedNode.name;

/***************************************************************************************** **************/

 

I get the error

/***************************************************************************************** *************/

TypeError: c3d.scene.selectedNode is undefined

19:Console:Exec

undefined

/***************************************************************************************** *************/

 

I have placed my code at the folder level.

Can someone help please?


ENTER SINGLE CHARACTER IN SAME SIZE TEXT BOX THEN REPOSITION

$
0
0

B

 

WANT TO ENTER ON PDF CONVERTED FROM JPG THEM MOVE IT AROUND

Adobe Acrobat Message : ''To view the flash technology content in this PDF, please install the version of flash player that supports Adobe reader and acrobat "

$
0
0

I am using interop acrobat dll in one of my client , when trying to open a pdf file in acrobat X the following message appears :

 

''To view the flash technology content in this PDF, please install the version of flash player that supports Adobe reader and acrobat "

 

Is there any workaround to fix this issue ?... 1.png

will installing the flash player fix the issue ?

 

thanks

To retain color space value for Monochrome images during flattening.

$
0
0

In our project, we are extracting image content from PDF file and doing some raster operation by using LeadTool and then flattening the processed image in PDF file.

 

Input PDf file: One page which has monochrome image

For extracting image content from PDF file, we are using below Acro Plugin API:

AVConversionConvertFromPDFWithHandler

 

After this, we will perform some raster operations by using LeadTool and then flattening will happen.

 

While doing flatten we are performing below operations in sequence:

1. Set bitspercomponent  =1.

2. Create a new color table using DeviceRGB.

3. Create image by using below Acro Plugin API:

pdeimage = PDEImageCreate(&attrs, sizeof(attrs), &matrix, 0, cols1, NULL, &fil, asstm, NULL, 0);

4. Add image in PDF content.

 

Now flattening is successful, but monochrome(Original Image format) is changed to RGB. We want to retain the color space(DeviceGrey).

 

We have tried the below solution to retain the color space:

1. Using the old image's color space value for new image creation. But this gives inverted color(Black to White and vice versa)

Please help us to retain the color space while flattening.

Passing "ActiveDoc" to query method fails with exception (.NET IAC)

$
0
0

Here is my code example (in C#):

 

Type AcrobatAppType = Type.GetTypeFromProgID("AcroExch.App");

Type AcrobatAVDocType = Type.GetTypeFromProgID("AcroExch.AVDoc");

 

CAcroApp app = (CAcroApp)Activator.CreateInstance(AcrobatAppType);

CAcroAVDoc doc = (CAcroAVDoc)Activator.CreateInstance(AcrobatAVDocType);

if (doc.Open(@"C:\SomeRandom.pdf", ""))

{

CAcroPDDoc pdDoc = doc.GetPDDoc();

Object jso = pdDoc.GetJSObject();

Object search = jso.GetType().InvokeMember("search", BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance, null, jso, null);

Type searchType = search.GetType();

searchType.InvokeMember("query", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance, null, search,new Object[]{ "long word"}); // PROBLEM HERE

}

 

The problem I am having is with the last line. If I change "new Object[]{ "long word"}" to "new Object[]{ "long word", "ActiveDoc"}", I get a TargetInvocationException.

According to the JavaScript documentation:

(optional) Specifies where the text should be searched. Values are:

ActiveDoc
Folder
Index
ActiveIndexes

The default is ActiveIndexes.

 

My code example shown above works when passing "Folder", "ActiveIndexes" and "Index". The only argument that does not work is "ActiveDoc" and I'm not sure why.

Any clue or solution into what the problem may be would help.

Add image in uploaded pdf file and then save it specific location using C#

$
0
0

I need to upload a pdf file and then add image in that file and then save it in specific location. This process should be in C# . Is it feasible or not in Acrobat XI Pro ?

Working with acrobat.dll

$
0
0

Hello all,

I am completely new to this forum, and I hope it's a right place to ask what I am going to ask. I am trying to develop application, that could take some pdf document, and to add field on certain page at certain coordinates. There will be a further use of this field, but it is not of inetrest so far. To achieve this, I am using Adobe Acrobat 7.0.5 SDK installed on my machine. I created a .Net project and added Acrobat.dll as a project reference. To be able to get to document object, I instantiate object of class AcroAVDocClass, and here the problem starts. Application fails to run, with such an error:

 

Retrieving the COM class factory for component with CLSID {72498821-3203-101B-B02E-04021C009402} failed due to the following error: 80040154.

 

After googling a lot, I know that it is a problem related to registering the component. Indeed, I cannot find this dll in the list of registered COM components in "Add reference" window of my MS Visual Studio 2003, and it is not on the list of .NET components as well. I tried to register the dll by means of regsvr32 - it failed as well, saying:

 

C:\Program Files\Adobe\Adobe Acrobat 7.0.5 SDK\InterAppCommunicationSupport\PIAs\Acrobat.dll was loaded, but the DllRegisterServer entry point was not found. The file cannot be registered.

 

Does anyone have any idea what I supposed to do? I'll very appreciate any hint.

 

Thanks in advance!

Broker processes for Reader 10

$
0
0

I have a plugin that requires access to a COM object. To make this work in protected mode, I created a broker process using the sample project from the Adobe XI SDK. The plugin now works in Reader 11, but not in Reader 10. Is there a way of making the broker sdk work in Reader 10? If not, how would I go about creating and running a broker process for Reader 10?


Reader Plugin License Request Delays

$
0
0

Can someone from Adobe, or in the know, comment about the wait times for a license to develop plugins for Reader? I've filed a request more than a month ago and still haven't heard anything back...

How to specify a tint value via Scrobat SDK.

$
0
0

The Illustrator SDK sets the tint value in spot color, it is possible to change the color tone.

In the Acrobat, I want to set the tint in the same way.

I created a color in the Acrobat plugin, and I painted the color to an art path.The Acrobat plugin create a color to CosObject as a spot color.

Then, I do not know how to set the tint to this color.

I have created a color in the following code, but I do not know how to set the tint value.

I do not care about the LAB.

 

Please tell me how to set the tint value as the Illustrator.

 

====

PluginMain(){

 

    (…omitted…)

    PDEContent volatile pdeContent = NULL;

 

    PDEPath path = PDEPathCreate();

    ASInt32 paintOp = 0x00;

    paintOp = kPDEFill | kPDEStroke;

    PDEPathSetPaintOp(path, paintOp);

   

    (…omitted…)

 

    PDEColorSpec pdeColorSpec;

    pdeColorSpec = createColorSpec(pdDoc);

 

    PDEGraphicState gstate;

    memset(&gstate, 0, sizeof(PDEGraphicState));

    gstate.strokeColorSpec = gstate.fillColorSpec = pdeColorSpec;

 

    (…omitted…)

 

    PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)path);

    updateDocument(pdeContent, pdPage);

    (…omitted…)

}

 

createColorSpec(PDDoc pdDoc)

{

    PDEColorSpace colorSpace = createSampleColor(pdDoc);

 

    PDEColorValue pdeColorvalue;

    memset(&pdeColorvalue, 0, sizeof(PDEColorValue));

 

    pdeColorvalue.color[0] = ASInt32ToFixed(0);

    pdeColorvalue.color[1] = ASInt32ToFixed(1);

    pdeColorvalue.color[2] = ASInt32ToFixed(0);

 

    PDEColorSpec pdeColorSpec;

    pdeColorSpec.space = colorSpace;

    pdeColorSpec.value = pdeColorvalue;

   

    return pdeColorSpec;

}

 

 

createColorSpec(){

 

    PDEColorSpace spotColorSpace;

    CosDoc cosDoc = PDDocGetCosDoc(pdDoc);

    char *functionText = "{50.0 -128.0 -128.0}";

 

    // Domain

       CosObj domain = CosNewArray(cosDoc, false, 2);

    CosArrayPut(domain, 0, CosNewFloat(cosDoc, false, 0.0f));

    CosArrayPut(domain, 1, CosNewFloat(cosDoc, false, 1.0f));

 

    // Range

    CosObj range = CosNewArray(cosDoc,false,6);

    CosArrayPut(range, 0, CosNewFloat(cosDoc, false, 0.0f));

    CosArrayPut(range, 1, CosNewFloat(cosDoc, false, 100.0f));

    CosArrayPut(range, 2, CosNewFloat(cosDoc, false, -128.0f));

    CosArrayPut(range, 3, CosNewFloat(cosDoc, false, 127.0f));

    CosArrayPut(range, 4, CosNewFloat(cosDoc, false, -128.0f));

    CosArrayPut(range, 5, CosNewFloat(cosDoc, false, 127.0f));

 

    // create dictionary

    CosObj tintTransform = CosNewDict(cosDoc, false, 4);

    CosDictPut(tintTransform,ASAtomFromString("FunctionType"),CosNewInteger(cosDoc,false,4));

    CosDictPut(tintTransform, ASAtomFromString("Domain"), domain);

    CosDictPut(tintTransform, ASAtomFromString("Range"), range);

 

    ASStm asStm = ASMemStmRdOpen(functionText, strlen(functionText));

    CosObj function = CosNewStream(cosDoc, true, asStm, 0, true, tintTransform, CosNewNull(), -1);

    ASStmClose(asStm);

 

    // create Lab

    PDEColorSpace altSpace = createLab(pdDoc);

    PDESeparationColorData data;

 

    data.alt = altSpace;

    data.name = ASAtomFromString("MyColor");

    data.size = sizeof(data);

    data.tintTransform = function;

 

    PDEColorSpaceStruct clrStruct;

    clrStruct.sep = &data;

   

    spotColorSpace = PDEColorSpaceCreate(ASAtomFromString("Separation"), &clrStruct);

 

}

 

 

PDEColorSpace createLab(PDDoc pdDoc)

{

    PDEColorSpace labColorSpace;

    CosDoc cosDoc = PDDocGetCosDoc(pdDoc);

    // Lab

    CosObj csLab = CosNewArray(cosDoc, false, 2L);

    CosObj csLabDic = CosNewDict(cosDoc, false, 3L);

    // WhitePoint

    CosObj csWhitePoint = CosNewArray(cosDoc, false, 3);

    CosArrayPut(csWhitePoint, 0, CosNewFloat(cosDoc, false, 0.964203f));

    CosArrayPut(csWhitePoint, 1, CosNewFloat(cosDoc, false, 1.0f));

    CosArrayPut(csWhitePoint, 2, CosNewFloat(cosDoc, false, 0.824905f));

    CosDictPutKeyString(csLabDic, "WhitePoint", csWhitePoint);

    // Range

    CosObj csRange = CosNewArray(cosDoc, false, 4L);

    CosArrayPut(csRange, 0, CosNewFloat(cosDoc, false, -128.0f));

    CosArrayPut(csRange, 1, CosNewFloat(cosDoc, false, 127.0f));

    CosArrayPut(csRange, 2, CosNewFloat(cosDoc, false, -128.0f));

    CosArrayPut(csRange, 3, CosNewFloat(cosDoc, false, 127.0f));

    CosDictPutKeyString(csLabDic, "Range", csRange);

    // BlackPoint

    CosObj csBlackPoint = CosNewArray(cosDoc, false, 3);

    CosArrayPut(csBlackPoint, 0, CosNewFloat(cosDoc, false, 0.0f));

    CosArrayPut(csBlackPoint, 1, CosNewFloat(cosDoc, false, 0.0f));

    CosArrayPut(csBlackPoint, 2, CosNewFloat(cosDoc, false, 0.0f));

    CosDictPutKeyString(csLabDic, "BlackPoint", csBlackPoint);

    CosArrayPut(csLab, 0L, CosNewNameFromString(cosDoc, false, "Lab"));

    CosArrayPut(csLab, 1L, csLabDic);

    labColorSpace = PDEColorSpaceCreateFromCosObj(&csLab);

    return labColorSpace;

}

====

Updating Output Preview window

How to count pages with Adobe Reader XI

$
0
0

Hello, experts!

My task - to count the pages in PDF file.

I have a Adobe Reader XI, Windows 8 x64

 

I make a scripts inside my program on VBS (Visual Basic Script). It is not problem to integrate my program with other application using ActiveX, COM, OLE etc.

This time I already observed information on this forum about how to CreateObject() as Adobe Reader. Now I write this code:

 

 

 

  1. Set gApp = CreateObject("AcroPDF.PDF.1") 
  2. gApp.LoadFile("...path/File.pdf") 

But when I run app anything doesn't work. In Application Manager of Windows the Adobe Reader app doesn't appear.

For example this code does work:

 

 

  1. msgbox gApp.GetVersions 

 

Also I can find AcroPDF.PDF.1 in list on ActiveX controls inside the Windows. Maybe to solve my task I should use Adobe Acrobat with CreateObject("AcroExch.AVDoc") but I'd like to try free version.

I found this Adobe PDF Library SDK | Adobe Developer Connection

Besides the technologies provided by the Acrobat SDK, you can also use the PDF Library (PDFL) to develop applications that create and manipulate PDF documents but do not interact with Acrobat.

1. So what I should to install at first to use just Adobe PDF Library SDK?

2. Maybe I should install Acrobat SDK, but it just for Acrobat, not for Reader...

3. And how I can count pages in PDF from my external app?

 

Thanks to all!

Acrobat 4.0 API - Problem with highlighting

$
0
0

I am using VB6 and Acrobat 4.0 because for now it's the only that works on an old pc that I have.

 

I need to highlight a word in a document and put an annotation on it. this is the code that I use (I omit the declarations) :

'list

hiliteList.Add 0, 32767

 

'acquiring the page

Set pdPage = pdDoc.AcquirePage(0)

 

'setting the document highlite

Set wordHilite = pdPage.CreateWordHilite(hiliteList)

 

'the word to find in the document

wordFind="1234/1"

 

'looping in the document

For idx = 0 To wordHilite.GetNumText - 1

     'taking the word for searching

     word = Trim(wordHilite.GetText(idx))

     If word = wordFind Then

          'word FOUND and setting the new list with only the found item

          Set hiliteListOk = CreateObject("AcroExch.HiliteList")

          hiliteListOk.Add idx, 1

          'creating the highlight

          set wordToHilite = pdPage.CreatePageHilite(hiliteListOk)

          'Debug.Print wordToHilite.GetText(0)

          'setting selection

          avDoc.SetTextSelection wordToHilite

          'getting the rectangle

          Set myrect1 = wordHilite.GetBoundingRect

          'getting then selection with the rectangle

          Set textSel = pdDoc.CreateTextSelect(0, myrect1)

          avDoc.ShowTextSelect

          Exit For

     End If

Next

 

the problem is that after I found the right word, I create the new list ( hiliteListOk ) with only the item that I want, but the result is not the same.

For example : I find looping the item no 113 (getting it from the looping variable 'idx'), but when I create the new highlight list with only the right item putting no. 113 in the index the text in this item is not the same of the looping.

In the object wordHilite I find item 113 = "1234/1" and putting the 113 as offset in the instruction  hiliteListOk.Add 113, 1 I got a different text.

Looping the document the string "1234/1" is wholly taken, but assigning the index directly the string is splitted into 3 strings : "1234" "/" "1" so the index does not correspond anymore.

 

Any solution  for this problem ?

 

thanks to all that will give me help.

Editable Dropdown Box Issue

$
0
0

I am creating a pdf file on acrobat for a company that has new people come to work every week. I want to create a dropdown box allowing the employers and or employees that are using this particular pdf to be able to type in a name into the drop down box and it automatically saves that name so that the drop down box below will also have the name inside, that they currently entered. Doing this will make it easy so I wouldn't have to update the file every time they hire a new employee.

Can we register an icon into AVCommand?

$
0
0

I am trying to make a custom-made command using AVCommandHandler.

The custom-made command which I created is functioning normally.

However, a command is classified into the "Others" group in an action dialog.

Moreover, there is no icon in it.

Is it possible to register an original icon to a custom-made command?

Moreover, is creating an original category possible?


PDF.OCX or AcroPDF.DLL

$
0
0

We have a Powerbuilder 9 and 10 application that use to use PDF.OCX, but we can no longer register the

file.  We have also read this is no longer supported so we started investigating AcroPDF.DLL.  Problem is no matter what we register, we receiv

e an error and this was the same error we receive when we register the PDF.OCX.  We recently updated our machines to Windows XP Sp3, but that appears to be the only thing that was done.  I have downloaded the Acrobat SDK and cannot figure out what we'd do to have Powerbuilder be able to choose the com object.

"DLL RegisterServer in acroPDF.DLL failed. Return code was 0x80004005"

 

Any help would be appreciated plz.  Thanks.

Pdf Color Conversion (to RGB)

$
0
0

I discover this way to convert the pdf pages color to RGB using the Acrobat API in a custom plugin and Acrobat 10 Pro:

         PDColorConvertAction colorConvertActionStruct = (PDColorConvertAction)malloc(sizeof(PDColorConvertActionRec));     memset(colorConvertActionStruct, 0, sizeof(PDColorConvertAction));     PDColorConvertActionType actionType = kColorConvConvert;     colorConvertActionStruct->mAction = actionType;     colorConvertActionStruct->mMatchAttributesAny = -1;     colorConvertActionStruct->mMatchSpaceTypeAny = -1;        colorConvertActionStruct->mMatchIntent = AC_UseProfileIntent;     colorConvertActionStruct->mConvertIntent = AC_UseProfileIntent;     colorConvertActionStruct->mEmbed = true;     colorConvertActionStruct->mPreserveBlack = false;     colorConvertActionStruct->mUseBlackPointCompensation = false;     AC_Profile rgbProfile;     ACProfileFromCode(&rgbProfile, AC_Profile_AdobeRGB1998);     colorConvertActionStruct->mConvertProfile = rgbProfile;     PDColorConvertParams colorConvertParamsStruct = (PDColorConvertParams)malloc(sizeof(PDColorConvertParamsRec));     memset(colorConvertParamsStruct, 0, sizeof(PDColorConvertParams));     colorConvertParamsStruct->mActions = colorConvertActionStruct;     colorConvertParamsStruct->mNumActions = 1;     colorConvertParamsStruct->mInks = NULL;     colorConvertParamsStruct->mNumInks = 0;     ASBool *changed;        PDDocColorConvertPage(pdDoc, colorConvertParamsStruct, 1, NULL, NULL, 0, NULL, changed);     ACUnReferenceProfile(rgbProfile);

the problem is that I get an error of read memory violation at this line

...

PDDocColorConvertPage(pdDoc, colorConvertParamsStruct, 1, NULL, NULL, 0, NULL, changed);

...

actually when it's performing the color conversion.

 

Is there any reason because I get the error?

 

Thank you very much

Get rectangle from pdf C#

$
0
0

Hi I displaying my a pdf on my form using the Adobe PDF Reader

Once displayed the user can draw a rectangle using the Selection tool within Adobe

I would like to know if there is a way i can get the coordinates for the rectangle drawn by the selection tool

An intricate question rather than an idea: PDF structure LIVE EDITOR

$
0
0

I am wondering whether Dom's outline here(1) is really impossible:

 

For PoDoFoBrowser, I think it would be fine if you would have the preview side

by side with the pages content stream. And if you type some PDF code into the

content stream, like "0 0 1 rg 100 100 m 200 200 l" it should immediately

draw a blue line. But this is dreaming

 

I see top expert gurus such as Thom Parker have developed their own viewer/editor here(2), the PDFCanOpener. PoDoFoBrowser is also great. These guys here(3) made PDFXplorer.

So, why I couldn't find a tool like Dom's expectations. Adobe in first place should do that if technically possible. Together with Acrobat, it would exploit the creation of custom annotations.

Are there any reasons they haven't yet?

Confirmation That I Understand What I Can and Cannot Do With Adobe Reader XI and Adobe Acrobat Pro XI

$
0
0

I am new to working with Adobe Acrobat Pro XI and Adobe Reader XI.  Based on research I have done and questions answered in the Adobe Communities and Forum, I wanted to make sure I understand the limitations of these two products before I report back to my supervisor.  (We do not want to use XFA forms to obtain data in an xml file.)

 

 

1.  Adobe Reader XI will allow a user to save a fillable PDF document to his/her local PC.  But it is only possible to save it as a PDF.


2.  Adobe Reader XI will not allow a user to export the data in a fillable PDF into an xml file (unless you purchase the LiveCycle Reader Extensions license).


3.  Adobe Reader XI will not allow a PDF file to be displayed in a .NET program unless the "Enable Protected Mode at startup" checkbox in Preferences/Security(Enhanced) has been unchecked.  (The previous version of Reader would allow this without disabling security.)

 

 

4.  Adobe Acrobat Pro XI will allow a user to scan a form and create a fillable PDF.


5.  Adobe Acrobat Pro XI will allow a user to save the fillable form as a PDF or XML.  However, it is the form that is being saved as an XML file.  Not the data.


6.  Adobe Acrobat Pro XI will allow a user to export the data of a form into an xml file, an .fdf file, an .xfdf file, or a .txt file.

 

 

7.  If a programmer writes a program in .NET to save the data of a PDF as an .xfdf file using IAC code, it will only work on a PC that has Adobe Acrobat (Standard or Pro).  If we need this executable to work on other PCs, we would need to purchase additional licenses of Adobe Acrobat - a license for every PC that needs to run the executable.


8.  If a programmer writes  JavaScript code using trusted functions to get around security issues, that code will work on a PC that has Adobe Acrobat (Standard or Pro) but will not work on Adobe Reader XI.  Again, if we wanted our JavaScript to work, we would need to purchase Adobe Acrobat for every PC that would run the code.

 


Please let me know if I have understood all of this correctly.  Thank you.

Viewing all 2571 articles
Browse latest View live


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