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

Re: How do I open a new window in Adobe Acrobat using the plugin sdk

$
0
0

Hi,

 

The simplest possible way is to build an acrobat plugin with CLR support and use Winforms, try using the below mentioned configuration for your VC++ project.

 

Capture.JPG

Capture.JPG


Re: Please clarify license terms for the PDF test suites

$
0
0

Thanks for the clarification, although I must admit to being a little disappointed. We would like to be able to take an archival copy in case something happens to the live site, and ideally would like to be able to re-package it with additional metadata for tool testing and long-term preservation purposes.

Re: Please clarify license terms for the PDF test suites

$
0
0

As long as its for internal use – be our guest!

 

We just do not want you redistributing them on your site, with your product, etc.

Re: Please clarify license terms for the PDF test suites

$
0
0

Oh  and if you or anyone else needs other types of files that I haven't had a chance to put up there yet – please let me know!

Re: Please clarify license terms for the PDF test suites

$
0
0

We don't have a product - I am one staff member from a number of international 'memory institutions' (national libraries, archives, etc.) that all work together to understand and document digital formats for long-term preservation purposes. As we pool knowledge across organizations, limiting documents to 'internal use' is problematic.

 

Of course, we can share metadata about your documents, and refer to them by URL, but that gets tricky when we want to talk about details. Can we blog about a specific fragment of one of those documents? Can we include a screen shot? Where is the line? Simple licensing helps make this clear.

 

Also, frankly, we are playing a very long game and have to plan for the possibility that that website, and even Adobe itself, might not exist one day. This means we are not keen to become dependent upon test suites that cannot be kept safe by being cloned across our organizations.

 

EDIT: Hm, sorry if that came across as ungrateful. Thanks for offering to provide more examples, and of course, it's great to have these documents available (internal use is better than no use!). I just wanted to make it clear there are other use cases that these conditions can't cover.

Re: Please clarify license terms for the PDF test suites

$
0
0

Understood.  Will work with our legal team to see what we can do.

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

$
0
0

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

Re: How to add text to a pdf file using Access VBA??

$
0
0

You should look at the JSObject and how to call JavaScript methods from VB(A).  Then look at the addWatermark method.


Re: How to add text to a pdf file using Access VBA??

$
0
0

I've looked at that stuff until I'm blue in the face, and still don't get it. 

Re: How to add text to a pdf file using Access VBA??

$
0
0

I have to say 10 hours is not enough to scratch he surface of the SDK.

 

We tend not to give examples - well I don't. Instead I help people understand the documents and write their own code.


So, what is it about the addWatermark method which is stopping you from getting further? How can we help with that.

Re: How to add text to a pdf file using Access VBA??

$
0
0

I can't figure out how to call it. 

 

Public Sub AddText()

    Dim pdApp As Acrobat.AcroApp
    Dim pdDoc As Acrobat.AcroPDDoc
    Dim pdPage As Acrobat.AcroPDPage
    Dim jso As Object
    Dim doc As Variant
   
    Set pdApp = CreateObject("AcroExch.App")
    Set pdDoc = CreateObject("AcroExch.PDDoc")
    pdDoc.Open ("c:\Test\Test.pdf")
    page = pdDoc.AcquirePage(o)
    Set jso = pdDoc.GetJSObject

 

*****************What do you do after you get the JSObject?
 
   
    doc = jso.pdApp.activeDocs

    pdDoc.Save 1, "c:\Test\Test.pdf"
    pdDoc.Close
    Set pdDoc = Nothing
    MsgBox "Done"

End Sub

Re: Digital Signature Not Showing Up

$
0
0

Test Screen Name, what is the syntax for that? 

 

Any help on the code to use?

 

Thanks,

 

Joani

Re: How to add text to a pdf file using Access VBA??

$
0
0

Jso.addWatermarkFromText( - parameters as defined in the JS docs - )

Re: How to add text to a pdf file using Access VBA??

Re: How to add text to a pdf file using Access VBA??

$
0
0

Just did that and I'm getting an error message,  "Object variable or With block variable not set."

 

Public Sub AddText()

    Dim pdApp As Acrobat.AcroApp
    Dim pdDoc As Acrobat.AcroPDDoc
    Dim pdPage As Acrobat.AcroPDPage
    Dim jso As Object
    Dim doc As Variant
    Dim oColor As Object
   
    Set pdApp = CreateObject("AcroExch.App")
    Set pdDoc = CreateObject("AcroExch.PDDoc")
    pdDoc.Open ("c:\Test\Test.pdf")
    Set jso = pdDoc.GetJSObject
    Call jso.addWatermarkFromText("WTF", 0, "Helvetica", 16, , 0, 0, True, True, True, 0, 0, 100, 100, False, 1, False, , , 1)

    pdDoc.Save 1, "c:\Test\Test.pdf"
    pdDoc.Close
    Set pdDoc = Nothing
    MsgBox "Done"

End Sub


Re: Digital Signature Not Showing Up

$
0
0

NO, YOU write the code. I've described what it has to do.

Re: How do I open a new window in Adobe Acrobat using the plugin sdk

$
0
0

Thank you kdj_banglore,

One question.  I setup the project as you explain in the screen shots and I get this error when I build:

 

error D8016: '/ZI' and '/clr' command-line options are incompatible

 

 

Any ideas.  Have you gotten this to work for you? I basically grabed the BasicPlugin sample project and made the changes you showed and a rebuild is giving me the error above.

Need Help Adding Parameters to addWatermarkFromText using VBA

$
0
0

After three days of banging my head on a wall, I got this to work:

 

Public Sub AddText()

    Dim pdApp As Acrobat.AcroApp
    Dim pdDoc As Acrobat.AcroPDDoc
    Dim jso As Object
   
    Set pdDoc = CreateObject("AcroExch.PDDoc")
    pdDoc.Open ("c:\Test\Test.pdf")
   
    Set jso = pdDoc.GetJSObject
    jso.addWatermarkFromText ("Test")

    pdDoc.Save 1, "c:\Test\Test.pdf"
    pdDoc.Close
    Set pdDoc = Nothing
    MsgBox "Done"

End Sub

 

However, every time I try to add parameters to jso.addWatermarkFromText I get an error message - something is wrong with my syntax I suppose but i have tried every example I could find and nothing is working for me.  Please help - all of the default parameters are find, just need the text to be at the top of the page, not the center.

Re: Need Help Adding Parameters to addWatermarkFromText using VBA

$
0
0

Now I'm trying the JSScript method and still stuck.  Not sure how to properly reference the app to use the app.constants.align.top parameter, etc.

 

Public Sub AddText()

    Dim App As Acrobat.AcroApp
    Dim pdDoc As Acrobat.AcroPDDoc
    Dim jso As Object
    Dim o As New ScriptControl
    o.Language = "JScript"
   
    Set App = CreateObject("AcroExch.App")
    Set pdDoc = CreateObject("AcroExch.PDDoc")
    pdDoc.Open ("c:\Test\Test.pdf")
  
   
    With o
        .ExecuteStatement "this.addWatermarkFromText({cText: 'Watermark Text',nTextAlign: App.constants.align.right,nHorizAlign: App.constants.align.right,nVertAlign: App.constants.align.top,nHorizValue: 0.4, nVertValue: 0});"
    End With
   
    pdDoc.Save 1, "c:\Test\Test.pdf"
    pdDoc.Close
    Set pdDoc = Nothing
    MsgBox "Done"

End Sub

Re: Need Help Adding Parameters to addWatermarkFromText using VBA

$
0
0

Where did you get the impression that you can execute JavaScript in Acrobat

using this method? You really (let me repeat that REALLY) have to read the

SDK documentation. There no no way around that. Anything that is not

described in the documentation will not work. There is only one way to

execute JavaScript using the IAC API, and that is using this call:

 

http://livedocs.adobe.com/acrobat_sdk/11/Acrobat11_HTMLHelp/IAC_API_Fo rmsIntro.108.45.html

 

However, in this case there is no need to use the executeThisJavaScript

function, you can use the JSO to add your watermark. Everything you need is

in the documentation, and as I mentioned before, there is no way around

reading and understanding the docs. You cannot just google your way through

a complex problem and try to piece together a solution based on bits and

pieces you find online. Why do I know this? Because oftentimes I get called

in after somebody tries that approach to save some money. I then get to

clean up the mess they made, and then it's not going to be cheap... And

this is one of the reasons why people are reluctant to provide code samples

in this forum.

 

Using a complex API as the Acrobat SDK requires you to climb a pretty steep

learning curve, and you have to spend weeks and months (and sometimes

years) reading and experimenting until you understand how things work. And

that is why it's usually cheaper and faster to hire somebody to do that

work for you.

 

Back to  your  problem. What have you tried? I only remember seeing your

call to addWatermarkFromText using just the text argument. BTW: There was

no need to start a new thread, you should have kept everything in the first

thread you started, this way everything is in one place. If you've posted

more in the other thread, then you are making it much harder for us to

provide help.

 

So again, what have you tried and what results have you gotten? What error

messages did the system produce? When? When you compiled the code, or when

you tried to execute it?

 

 

 

 

Karl Heinz Kremer

PDF Acrobatics Without a Net

PDF Software Development, Training and More...

 

khk@khk.net

http://www.khkonsulting.com

 

 

 

On Sat, Jul 27, 2013 at 8:31 AM, I Love Mustangs

Viewing all 10848 articles
Browse latest View live


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