how to unlock a locked document use acrobat API.in acrobat plug_in
plug_in:how to unlock a locked document use acrobat API
Extract data from multiple documents and save to a single document
I need to extract data from multiple documents and save to a single document is it possible ?
WinForms - Adobe AcroPDF Assembly Error
Hi,
I have a WinForms app that uses Adobe Reader dll (http://www.c-sharpcorner.com/uploadfile/hirendra_singh/how-to-show-pdf-file-in-C-Sharp/)
However, I get the below error. The Application is built with 'Any CPU' setting. This works fine on current environment. But in new windows desktop it gives below error...
System.IO.FileNotFoundException:The specified module could not be found.(Exceptionfrom HRESULT:0x8007007E) at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid,Object punkOuter,Int32 context,Guid& iid) at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid) at System.Windows.Forms.AxHost.CreateWithLicense(String license,Guid clsid) at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid) at System.Windows.Forms.AxHost.CreateInstance() at System.Windows.Forms.AxHost.GetOcxCreate() at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state) at System.Windows.Forms.AxHost.CreateHandle() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.AxHost.EndInit() at ReportViewer.UCReportViewer.InitializeComponent() at ReportViewer.UCReportViewer..ctor()
I also tried to register the AcroPDFLib.dll assembly but go error "The module was loaded but the entry-point DllRegisterServer was not found."
Any ideas?
how to change the owner of an annotation
i need to change the owner of the annotation to a specific person is it possible
How to create a plugin to stamp texts and not an image into a pdf document
How to create plugin to stamp texts and not an image.. i just want it to work like the stamper plugin found in sdk sample but here i need text to be stamped instead of an image.. Is it possible? kindly give me some ideas?how to go about it.. can this be done by modfying the stamper sample code?
Thank you
Problem with controlling Annotations from Excel VBA
Hi,
I have a PDF document that has plenty of sticky notes attached to it. These sticky notes have been added by multiple authors on all pages of the document. I am trying to import the contents of these sticky notes, their author and the page number to an excel spreadsheet. I am using Excel 2007 and Acrobat Professional 9.0.
This is the code that I am currently using to import the sticky notes, but the problem that I am facing is that when I run the macro -
- Same sticky note contents, author and page numbers are imported multiple times
- Not all sticky notes are imported, only some of them appear in the final excel spreadsheet
- When I compare the number of sticky notes to that in the original PDF file, the number is correct. But the content is repeated content and that is the reason why only some of the sticky notes are imported.
This is an activity that I need to do on regular basis and the number of sticky notes that I need to import to excel may range between 100 to 200. It is really difficult to do this task manually, so an excel VBA macro could prove really helpful.
Sub ImportComments_Click()
Dim Fpath As String
Dim WordObj As Object
Dim wbkOutput As Excel.Workbook
Dim iRow As Integer
Dim i, j, k As Integer
Dim lRet As Long
Dim objAcroAVDoc As New Acrobat.acroAVDoc
Dim objAcroPDDoc As Acrobat.AcroPDDoc
Dim numPages As Long
Dim lAnnotscnt As Long
Dim Subtype As String
Dim NumComments As Long
Dim AcroApp As Acrobat.AcroApp
Dim objAcroPDPage As Acrobat.AcroPDPage
Dim annot As Acrobat.AcroPDAnnot
Sheets("Defect Log").Select
Range("L3").Activate
Fpath = ActiveCell.Value
Sheets("Defect Log").Select
Range("A1").Activate
i = 0
Do While (Not (IsEmpty(ActiveCell.Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 1).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 2).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 3).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 4).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 5).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 6).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 7).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 8).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 9).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 10).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 11).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 12).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 13).Value)) Or Not (IsEmpty(ActiveCell.Offset(0, 14).Value)))
i = i + 1
ActiveCell.Offset(1, 0).Select
Loop
iRow = i + 1
Set wbkOutput = ActiveWorkbook
lRet = objAcroAVDoc.Open(Fpath, "")
Set objAcroPDDoc = objAcroAVDoc.GetPDDoc
numPages = objAcroPDDoc.GetNumPages()
Set objAcroPDPage = objAcroPDDoc.AcquirePage(0)
For k = 1 To numPages
lAnnotscnt = objAcroPDPage.GetNumAnnots()
For m = 0 To lAnnotscnt - 1
If lAnnotscnt = 0 Then Exit For
Set objAcroPDAnnot = objAcroPDPage.GetAnnot(m)
If (objAcroPDAnnot.GetContents <> "" And objAcroPDAnnot.GetSubtype = "Text") Then
Cells(iRow, 5).Value = k
Cells(iRow, 2).Value = objAcroPDAnnot.GetContents()
Cells(iRow, 11).Value = objAcroPDAnnot.GetTitle()
iRow = iRow + 1
End If
Next m
Set objAcroPDPage = objAcroPDDoc.AcquirePage(k)
Next k
lRet = objAcroAVDoc.Close(1)
Set objAcroAVDoc = Nothing
Set objAcroPDAnnot = Nothing
Set objAcroPDPage = Nothing
Set objAcroPDDoc = Nothing
End Sub
flattenPages via c#
Hi,
I was wondering how I could use the JSObject to flatten pages via JavaScript using the Adobe SDK. Below is the sample that I'm using.
CAcroApp acroApp = new AcroAppClass();
CAcroAVDoc avDoc = new AcroAVDocClass();
if(!avDoc.Open (FORM_NAME, ""))
{
string szMsg = "Cannot open" + FORM_NAME + ".\n";
Console.WriteLine(szMsg);
return;
}
.... Fill all the fields I need ...
CAcroPDDoc pdDoc;
pdDoc = (CAcroPDDoc)avDoc.GetPDDoc();
var obj = pdDoc.GetJSObject();
Type t = obj.GetType();
object[] param = new object[3];
try
{
t.InvokeMember("flattenPages", BindingFlags.InvokeMethod, null, obj, param);
}
catch (Exception e)
{
}
pdDoc.Save((short)(PDSaveFlags.PDSaveFull), "c:\\temp\\testfile.pdf");
pdDoc.Close();
avDoc.Close(1)
However when doing so I receive an exception stating
{"NotAllowedError: Security settings prevent access to this property or method."}
Is there something I am missing?
Thanks in advance for any insights.
Opening pdf from external C# application
I have been trying to get a pdf to open consistently in my Winform app's window with the following code:
AcroApp app = new AcroApp();
AcroAVDoc avDoc = new AcroAVDoc();
string myPath = "C:\\Users\\Jeff\\SkyDrive\\";
string myFile = "Child Support Data Sheet, Lake County.pdf";
//bool success = pdfDoc.Open(myPath + myFile, myFile);
app.Lock("Jeff's Program");
bool success = avDoc.OpenInWindowEx(myPath + myFile, this.Handle.ToInt32(),
(int)Acrobat.AVOpenParams.AV_DOC_VIEW, 1, 0, (short)Acrobat.PDViewMode.PDFullScreen,
(short)Acrobat.AVZoomType.AVZoomFitWidth, 0, 0, 0);
// bool success = app.Show();
MessageBox.Show(success.ToString());
avDoc.Close(0);
app.UnlockEx("Jeff's Program");
For whatever reason, it does not work most of the time. The Form1 window is blank, although sometimes, it contains the pdf. I have been trying to deal with that, but I have a more important question, first. Even if I get it working correctly, will it work on computers where end-users only have Acrobat Reader? If not, I need to look for another way. If it will work, I need to keep debugging (so does anyone have any suggestions)?
Acrobat IAC: search and highlight text
Hi,
i'm trying to write an c# application using IAC and JSO to search pdf files for specific words and Highlight the search results with the Highlight Annotation.
The pdf contains Pictures and large amounts of rotated text (90° and 180°) before i start programming i would like to know if my Task is possible.
I took a look into the SDK and found the "getPageNthWord()" and the "getPageNthWordQuads()" methods.
Is it possible to search the pdf document for e.g. "R405" with the results of "getPageNthWord()" and Highlight the word using the quads provided by "getPageNthWordQuads()" ?
Do i have to Combine the results of "getPageNthWord()" to my desired word (are the results real words or could the results consist of splitted parts e.g. "Hel" + "lo") or do i get 'real' words from this method?
Also can the "getPageNthWordQuads()" handle rotated text?
I hope that my application can replicate the results of the "Ctrl+F" function, which is able to find all desired words.
Thanks in advance.
Best regards,
Chris
PDETextItem for utf-8 characters
hi i want retrieve text with "PDETextItemCopyText" standard characters copy well but utf-8 character like arabic characters
(ت ی چ خ ز ر س , ....)
are not
what can i do for solving this problem ?
CosObj kid1 = CosArrayGet(obj3,pageNumber);
CosObj cosst = CosDictGet(kid1,ASAtomFromString("Contents"));
CosObj resou = CosDictGet(kid1,ASAtomFromString("Resources"));
PDEContent pddd=PDEContentCreateFromCosObj(&cosst,&resou);
PDEElement ele=PDEContentGetElem(pddd,i);
PDEText tText;
tText=reinterpret_cast<PDEText>(ele);
PDETextItem pdeti= PDETextGetItem(tText,f); |
int lll=PDETextItemGetTextLen(pdeti);
buf= (ASUns8*)ASmalloc(lll+1);//(ASUns8*)malloc(lll+1);]
memset(buf,0,lll+1);
PDETextItemCopyText(pdeti,buf,lll);
memcpy((char*)tempref,(char*)buf,lll);
original text like this
what i can show after fetch text and reproduce pdf file like this
thanks for your help
Slow performance on PDPageSetPDEContent
Has anyone else had this problem? I'm trying to add some labels to a page, and it works fine on pages with a little content. As soon as the level of content goes up, PDPageSetPDEContent takes a long time, up to 15-20 seconds per call. The really odd thing is that it doesn't matter how many labels there are, whether it is one or up to fifty, the elapsed time is roughly the same, within a second or two...
Thanks
Joe White
Does Acrobat support KSP?
I have a question about SHA-256 signature in AcrobatX.
I tried SHA-256 electronic signature to a PDF file using Acrobat on Windows 7.
In Acrobat XI, I could create electronic signature with SHA-256 by KSP.
However, in Acrobat X, I received the following error.
(I use same signature mechanism.)
The Windows Cryptographic Service Provider reported an error:
The keyset is not defined.
Error Code 2148073497
Does Acrobat X support both CSP and KSP? or only CSP?
To careate electronic signature with SHA-256 by KSP in Acrobat X, SDK should be required?
axAcroPDF.setView("Fit") not working
I'm writing a VS 2013 C# winform app and using the axAcroPDF Actice-X/COM PDF reader component.
My PDF page (a single page) always loads in showing the top 2/3's of the page and not the whole page vertically. The width of the page is fine and shows the entire width.
axAcroPDF.setView("Fit") is supposed to show the whole PDF page but it does not do that.
I must be missing something or mis-understanding the API doc?
Thanks...
Insert/Add text to pdf
Can anyone please post a sample code(Just a function to give me some idea) for Adding or Inserting text to the pdf... Am trying hard and not able to do it. .
Thanks
PRC Compressed Tessellation
Hi,
We are working on a program that should be able to output PRC files. For various reasons, we are not able to use the SDK, but must instead write the file bit by bit. To better understand the structure of a PRC-file, we decided to start out by reading already existing files. Everything went smoothly until we ran into the compressed tessellated data section (SerializeHighlyCompressed3DTess), where Huffman coding is applied.
According to the PRC working draft and the PRC Format Specification, the huffman data is stored as unsigned integers. However, when we interpret the data that way it turns out that number of bits for each integer is sometimes larger than 32, indicating that the WriteUnsignedInteger-method was not used to produce the data at all.
All the previous data in the stream seems to be all right, which makes us quite sure that we are reading at the right position in the bit stream.
This is the file we are trying to read. Is there any additional documentation on the PRC file format available? Is it possible that some other method than WriteUnsignedInteger should be used to store huffman data?
Any help would be much appreciated!
Is it possible to create a PDDoc object directly from the content stream (or byte array) in memory instead from a physical file?
I want to read a pdf that has been saved to the database and if it has been signed display the signer's name and the sign date to the user. If the file is first saved to a physical location I can do this with the SDK/ JSObject it there anyway I can do this without a physical file? This is part of a C# application.
page change event
Hi
In adobe api how can find that when page view ( or page ) change
I find
AVPageViewDidChange
but cant use this function
my question is how find page change ?
then with
AVPageViewGetLastVisiblePageNum
i can retrive page number
How to know objects position inside a form or container ?
Hi,
I am facing problems while parsing PDE Layer objects acording to their postion. The problem is that neither PDEElementGetMatrix nor PDEElementGetBBox is
giving exact co-ordinate of the objects for objects which are present inside a form or container.
Till some extent Exact matrix value I could achive in this way,
Exact value of Matrix.h = matrix.h (obtained by PDEElementGetMatrix) + formContainerMatrix.h (matrix.h of form and containers hiriarchially containing the object)
Exact value of Matrix.h = matrix.v (obtained by PDEElementGetMatrix) + formContainerMatrix.h (matrix.v of form and containers hiriarchially containing the object)
But there are certain cases where I see
Exact value of Matrix.h = formContainerMatrix.h (matrix.h of form and containers hiriarchially containing the object)
Exact value of Matrix.h = formContainerMatrix.h (matrix.v of form and containers hiriarchially containing the object)
So can anyone please let me know how to know in which situation former rule is applicable and in which situation later rule is applied.
or
Simply if any one can let me know, how to get the exact position of an object in PDELayer ..?
Thank you
Saffiuddin Sheikh
jso.getAnnots() returning duplicate name (key) stamps
I'm using VBA to parse a document for comments, and storing them in a dictionary object. I ran into an issue where jso.getAnnots is returning a duplicate name for an item.
Looking into the issue, there are comments with the same text that don't cause this issue.
Looking for a fix and the cause of this issue.
Why would it generate an identical name for a different comment? We've run hundreds of documents with this before and this issue has never occurred before. The name seems to be a unique key, such as "820edea8-c848-432a-aadd-987316a9ea7f".
Here's a snippet of the code:
jso.syncAnnotScan()
Annots = jso.getAnnots()
'
' Pass one - get all the comments.
'
Dim Annots As Object
Dim Annot As Object
Dim acroAnnotation As Annotation
Dim childAnnotation As Annotation
Dim annotationSet As New Dictionary(Of String, Annotation)
Dim rootAnnotations As New Dictionary(Of String, Annotation)
For Each Annot In Annots
acroAnnotation = New Annotation(Annot, FromFilename)
annotationSet.Add(Annot.name, acroAnnotation)
If Annot.inReplyTo = "" Then
rootAnnotations.Add(Annot.name, acroAnnotation)
End If
Next Annot
It crashes at annotationSet.Add(Annot.name,acroAnnotation)
GetJSObject() returns error "Value does not fall within expected range"
I'm trying to pull comments from an Acrobat XI document using VB.
app = CreateObject("AcroExch.App")
doc = CreateObject("AcroExch.PDDoc")
jso = doc.GetJSObject()
where jso (an Object) under 'message' says "Value does not fall within expected range". I recently updated the framework from Microsoft.NET 2.0 to 4.0 and was previously using the Adobe Acrobat 7.0 Type Library, which has been updated to the 10.0 type library. Somewhere, something stopped working, and I know the document has comments in it because I can see them when I open the document.
The next call is jso.getAnnots() which returns nothing.
Any help is much appreciated.
Thanks,