Add keywords to PDF with VBA

Hallo comunity,
I have a problem. I would add my metadata as keywords into a PDF using VBA. Somebody can help me ? It should be something like this
Sub AddKeyWord ()
     Dim kw, kw1, kw2 as String
     k1 = "Hallo"
     k2 = "World"
     k= k1 & ";" & k2
Rem here is the missing link ... tell the application ACROBAT to add the String "Hello; World" in the Keywordsfield
End Sub

You need to either use the Adobe XMP Toolkit SDK:  http://www.adobe.com/devnet/xmp.html
Or another option is to use the VBJSObject in the Acrobat SDK:  Current page: http://livedocs.adobe.com/acrobat_sdk/11/Acrobat11_HTMLHelp/IAC_DevApp_OLE_Support.101.13. html
Also you should be asking this question on the Acrobat SDK Forum:  http://forums.adobe.com/community/acrobat/acrobat_sdk

Similar Messages

  • Add Image in PDF with Alive PDF

    Hi community, i need help to add a image in PDF with Alive PDF.
    I try it so:
    [Embed(source="bilder/PDFLogo.png", mimeType="application/octet-stream" )]
    protected var PDFLogos:Class;
    printPDF.addImageStream(new PDFLogos() as ByteArray,15,5,190,0);
    But they gives me an error when i compiling.
    When i try it so
    printPDF.addImageStream(new PDFLogos() as ByteArray,ColorSpace.DEVICE_RGB)
    then i can compile but when i click on the button then can´t download the pdf please help

    Hi Kamil,
    Hello, I attached a piece of code we use, including statements, etc.. In my case, I captured all the content is a canvas to create a report of a bar chart or pie chart.
         import org.alivepdf.display.*;
         import org.alivepdf.fonts.*;
         import org.alivepdf.layout.*;
         import org.alivepdf.pdf.*;
         import org.alivepdf.saving.*;
    protected var pdf:PDF;
    // declared of logo or imagen on top of the PDF's document.
    [Embed(source="assets/logo.jpg", mimeType="application/octet-stream" )]
    protected var jpgBytes:Class;
    protected function savePDF(event:MouseEvent): void {
            pdf = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.LETTER);
            pdf.setDisplayMode(Display.FULL_WIDTH);
            pdf.addPage();
            pdf.addImageStream(new jpgBytes() as ByteArray, 10, 10, 0, 0, 1);
            pdf.setFont(FontFamily.ARIAL, Style.NORMAL, 12);
            pdf.addText("Grafico de Rata de Fallas", 100, 40); // title
            pdf.addImage(imprimirRata, 50, 50, 200, 150); // captured canvas with charts
    //      pdf.addImage(leyendaImprimir, 50, 120, 20,20); // captured leyend of charts
            pdf.addText("RTP Software. Modulo de Score Card.", 10, 200); // header of the document
            pdf.addText("Creado: " + new Date(), 180, 200); // Add the created date as a leyend or footer on document
            var fs:FileStream = new FileStream();
            var file: File = File.desktopDirectory.resolvePath("rtp-ratadefallas.pdf"); // Name of the file
            fs.open(file, FileMode.WRITE);
            fs.writeBytes(pdf.save(Method.LOCAL));
            fs.close();
            Alert.show("El reporte ha sido generado", "Informacion"); // Confirmation message as a pop-up
     

  • Add hyperlinks to pdf with script

    Hello,
    We have some pdf's in which we would like to add hyperlinks to a bunch of specific words. We would like to do this with a script.
    Just, I have no clue on how to do this with Adobe Acrobat. For the Word documents I can use VBA...
    Could somebody help me?
    Thanks!

    To develop with Acrobat you will need the Acrobat SDK. Forum here: Acrobat SDK

  • Populate a PDF with VBA and FDF, stopped working.

    I work with a non-profit children's camp where I need to be able to populate a PDF form from a MS Access database. The problem is that I do not have much server access, so I've had to find sneaky ways to do this. I can not use anything I have to install. I have been using FDF and VBA because it is what I know. Last year it stopped working in Chrome. This year it won't work in Firefox or IE either. I have to assume some change in security. It seems the problem is that PDF no longer open in my browser but download to the temp folder and open with Acrobat. This of course keeps my form from contacting the server to populate the form. I had been using a "update data" button to populate the form that opens in browser. Does anyone know of a way to do what I am trying to do without purchasing expensive software. I need to rely 100% on the user having reader.
    The file can be downloaded or viewed here (though it doesn't show the button unless you download, though it used to);
    http://www.camphunt.com/data/pdf_registration.pdf

    I guessed that was the case but testing it on several computers then and now the default handling seems to have changed. I am now looking for a way to do this either a different (but similar) way or to somehow get around this change.

  • How to change color of an annotation on PDF with VBA

    hi
    i 'm not sure i'm at the good place and i even don't know if it's posible
    on one side
    i'm using acrobat pro 9 to make square on industrial plan (P&ID).
    square are red or green in fonction of theire status.
    on the other side
    i'm using excel to list all equipement  and theire status that should be notify on my DPF
    i would like a macro on excel that check all statuts and give the good color to the square refering to the equipment listed on excel?
    thx

    Greatestdan wrote:
    I know there should be some way to change the colors of just specific areas of text like this. It should be as simple as putting a color code at the start and end of the tag like
    <div><color="#FF0000">This text should be RED</color></div>
    I tried that and it came up with the error "Invalid Markup, This is not the correct format for an HTML tag."
    I am about 99% certain you can change colors of specific div tags using color codes without giving them an Id and making a css rule for them, I just don't know how. This is a simple question and it should be a simple answer.
    Correct:
    <div style="color: #ff0000;">This text should be RED</div>

  • MS Project and print automatically a planning per ressource with VBA code for instance

    Hello, i'm in MS project 2010 and i would like to print automatically a planning per ressource (PDF) with VBA code or other quick way.
    Somebody can help me with a simple macro VBA and how to install/use it?
    regards,
    M.

    Probably oyu need the loop:
    Dim Res as Resource
    for each Res in ActiveProject.Resources
        'Apply resource filter then print
    Next Res
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Can I add a simple PDF to the forms site?

    I am looking to add a simple pdf - with no form content to my website and use my forms account to do so.  Is that possible?  I tried importing a pdf, but it needs editable content.  Thank you for any help.

    Hello Nancy,
    1. You can embed the form in your website as a widget.
    Go to "Distribute" Tab -> then look out for script under "Embed Form".
    2. You can also save your Formscentral form as a PDF form and then host the PDF separately and give its link in your website.
    Regards,
    Anoop

  • Extend Features in Adobe Reader with VBA?

    I merge two PDFs with VBA in MS Access by using Adobe Acrobat X and save the new file with a new name. Before saving the file I want to set "Extend Features in Adobe Reader". But after App.MenuItemExecute "DIGSIG:UBDoc" a popup is opened and I have no idea to go on with saving the PDF.
    Is there any way to set "Extend Features in Adobe Reader" without the popup and save the PDF with the new name in VBA?

    Not possible with Adobe Acrobat. You may check this product:
    http://www.adobe.com/products/livecycle/readerextensions/

  • How can I add a hyperlink to a PDF with OSX 10.9? The "Help" article says to use the "add link" feature under "edit." It's not there.

    How can I add a hyperlink to a PDF with OSX 10.9? The "Help" article says to use the "add link" feature under "edit." It's not there. I could add links w/ the previous OS. Time sensitive project.

    Which application are you using?
    Clinton

  • Can we set the Option "Show add-in user interface errors" with VBA?

    Does anyone know if the advanced Option "Show add-in user interface errors" can be set with VBA in Project Pro 2013?
    \Spiro Theopoulos, Montreal, QC (Canada)

    Spiro,
    Sorry but as far as I know that option is not available through VBA.
    John

  • Please add the option to be able to upload/link new pdfs with the in-browser editing. I have a restaurant client who is constantly updating their menu! Please help so they can do this themselves!

    Please add the option to be able to upload/link new pdfs with the in-browser editing. I have a restaurant client who is constantly updating their menu! Please help so they can do this themselves!

    Thank you so much for your help! I am so relieved. I will have explain how to do this to my client, but a big weight is off my back!
    A long learning process and actually such an easy fix. So glad you responded. Again thank you...

  • Need help with VBA to control PDF fields

    Hi,
    I am attempting to use Excel VBA to control Acrobat but cannot find any documentation on the syntax to modify fields within the PDF form.
    I am able to commnicate with Acrobat using CreateObject ( "AcroExch.App") and point to the AVDocs, PDDocs, PDPage objects.
    However, I cannot find any methods that would allow me to change fields on the PDF.
    I am attempting something very similar to a mail merge where I
    Open a template PDF document
    Populate the LastName, First Name fields
    Then lock (make fields ReadOnly) the above so the User cannot modify them
    Then save the PDF with the prefixed Lastname & First Name.
    The template PDF form is created in LiveCycle Designer & is a fillable PDF. It can be filled in Adobe Reader.
    Am using Office 2007 Excel with the corresponding VBA - The VB code has a Reference to Adobe Acrobat 9.0 Type library.
    Thanks

    For an XFA document, try using the JSObject (http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/IAC_DevApp_OLE_Support.100.1 3.html) to control the form. I haven't tried this, but I think it's your best chance for the second and third things you list.

  • When i add text to PDFs and work on the file for awhile, my red added text starts to turn into red X's with a box around them. I have OCRs turned off, i have the latest update, and i have registered the product. What is happening to my text while i'm work

    When i add text to PDFs and work on the file for awhile, my red added text starts to turn into red X's with a box around them. I have OCRs turned off, i have the latest update, and i have registered the product. What is happening to my text while i'm working on these files? On top of this, my red arrows get moved around also.

    Hi ,
    Could you please update me with few details like what version of Acrobat are you using?
    What OS do you work on ?
    Do you experience this any particular PDF or happens with all of them?
    Did you try the same with turning on the OCR ?Please check the same and compare the outputs .Does that help you in anyway ?
    If the file is not confidential ,could you please share the file with us so that we can analyse it our end and revert you with the appropriate answer .
    Please share the file on [email protected] and please cc [email protected] as well .
    Regards
    Sukrit Dhingra

  • Export to PDF with MetaData

    I have a script that exports each individual page to a pdf with each page having it's own metadata.
    It works fine except for on small thing.
    The keyword array looks like this in the final PDF.
    ; "Keyword1, Keyword2, Keyword3
    How do I get rid of the semicolon and quotes?
    Thanks!
    main ();
    function main() {
    var curDoc = app.activeDocument;
    var docPath = app.activeDocument.filePath; 
    // Array of paragraph Style names
    var paraStyleNames = ["meta-title", "meta-alt", "meta-subject"]; // insert here your para names !
    var missingParaStyles = [];
    // check, if the styles are valid
    for ( var p = 0; p < paraStyleNames.length; p++ ) {
        var curName = paraStyleNames[p];
        // if the style is missing, push it to the array
        if ( !curDoc.paragraphStyles.itemByName(curName).isValid ) {
            missingParaStyles.push( curName );
    var folderPath = new Folder(docPath + "/" + curDoc.name.replace(/\.indd$/,"") + "-pdf");
        if (!folderPath.exists)
            folderPath.create();
    // loop through all pages
    for ( var i = 0; i < curDoc.pages.length; i++ ) {
        // the current page
        var curPage = curDoc.pages[i];
    // Page number
        var pName = (curPage.name < 10) ? ("0" + curPage.name) : curPage.name;
       // controls the loop
        var controller = true;
      // all paragraphs on the current page
        var allPageParas = curPage.textFrames.everyItem().paragraphs.everyItem().getElements();
        // loop through all paragraphs and check, if one has the para style applied
        for ( var p = 0; p < allPageParas.length; p++ ) {
            if ( !controller ) break;
            // the current para
            var curPara = allPageParas[p];
            // loop through the styles
            for ( var n = 0; n < paraStyleNames.length; n++ ) {
                if ( curPara.appliedParagraphStyle.name == "meta-title" ) {
                    var docTitle = curPara.contents;
                   } // end if
                if ( curPara.appliedParagraphStyle.name == "meta-alt" ) {
                    var docAlt = curPara.contents;
                } // end if
             if ( curPara.appliedParagraphStyle.name == "meta-subject" ) {
                    var docKeywords = curPara.contents;
                    var docDirectory = Array(docKeywords); 
                } // end if
            } // end for paraStyleNames
        } // end for allPageParas
    for (var i = 0; i < docDirectory.length; i++) {
        docDirectory[i] = docDirectory[i].replace(/; /g, "");
        var filePath = folderPath + "/" + curDoc.name.replace(/\.indd$/,"")  + "-" + pName + ".pdf";
        var myFile = File( filePath );
        var pdfPreset = "Labels";
        with (curDoc.metadataPreferences){
        documentTitle = docTitle;
        author = curDoc.name.replace(/\.indd$/,"") ;
        description = docAlt;
        contentCreator = curDoc.name.replace(/\.indd$/,"")  + "-" + pName ;
        keywords =  docDirectory;
    with (app.pdfExportPreferences) {
      pageRange = curPage.name; 
      viewPDF = false }
      curDoc.exportFile( ExportFormat.PDF_TYPE, myFile, false, pdfPreset );
      } // end for > main

    You mean rendered on top of the image? That info is already embedded inside the image as metadata. To render metadata on top of your image, you can use the slideshow module, add a text overlay with your custom metadata and export to jpegs. You can do similar things inside the Print module but you cannot control the placement of the text.

  • Is it possible to tag a pdf with 'reject', so when it loads into Bridge, it will be pre-rejected?

    Is it possible to tag a pdf with 'reject', so when it loads into Bridge, it will be pre-rejected and not view (so long as 'show reject files' is unchecked in Bridge)? - Please see screen shot.
    We're wanting to have all pdf's initially set, so they don't view in Bridge, until the 'reject' tag is then removed.
    Any help would be great! Thanks.

    Well, not possible directly because the Acrobat interface doesn't allow changing Bridge's ratings and labels.  But as Omke Oudeman showed over in the Bridge Scripting forum, they are stored in the XMP metadata, where "Reject" seems to be an xmp:Rating of -1.  Thus you may be able to add this bit of metadata within Acrobat Pro by using the Append... [XMP template] command -- assuming you can come up with an XMP template, and can find the command buried in the interface (in Acrobat 9 it is behind the Additional Metadata button on the Properties/ Description tab, and then from there under Advanced).  Another route might be via Javascript.  Either way, before investing much time you should consider that most software won't see labels and ratings you add to the XMP metadata, and, as Omke mentions in that thread, their rendering seems somewhat fragile even in Bridge.
    Another route might be adapting a metadata category already available in Acrobt's interface: Keywords, say, "Approved" and "NotApproved".  (If you can't touch the Keywords, maybe you could re-purpose another of Acrobat's categories; and of course my suggestions are not related to Acrobat's stock stamps "Approved" and "Not Approved," a different kettle of fish).  Keywords might suffice for you to filter views in Bridge, but if you really want Bridge to show files with "Reject" then they must carry that tag.  If neither an XMP template nor an Acrobat Javascript serves, I imagine a Bridge script could apply "Reject" to files with the keyword NotApproved.  Of course, for any PDFs whose status changes you'd need to adjust both the Reject (xmp:Rating -1) and the keyword; perhaps another script could un-Reject and change the keyword to Approved in one step.

Maybe you are looking for