Using VB 2005 to detect whether a PDF is a collection

I'm having a bear of a time using my rudimentary programming skills (Visual Basic 2005) to write a utility that will scan a folder containing PDF files and then list which of them contains a collection (either a Package or a Portfolio).
I've been able to create the file-side piece (allow the user to select the folder, scan the folder and populate a ListBox with all PDF files in the folder).
Now I have to scan those PDFs and determine whether or not any of them are PDF Collections (I then hope to populate another ListBox with that list of files). That's where I'm confused.
I've seen a number of examples of Programming Acrobat JavaScript using VB. I've also found one reference in the PDFTron Knowledge Base that discusses figuring out whether a PDF is a Collection. He uses the following to do that:
Obj collection = doc.GetRoot().FindObj("Collection");
if (collection != NULL) {
//This PDF contains a Collection
I can follow in general what this code fragment is doing but I can't seem to translate it into something useable in VB 2005.
I'm guessing that I need to somehow use GetJSObject (or maybe I'm wrong) but I can't figure out how or in what context I can get the collection information.
Additionally, I'm hoping that when my program runs through the list of PDFs looking for the collection info, I can do it without having Acrobat (or Reader) open. I don't know if this is possible (all of the samples that I've seen seem to initially open Acrobat).
Thanks, in advance, for your help!

Thanks Leonard!
Oh, I've been reading the documentation - my head is spinning from reading it for the past 2 days ! :-)
Unfortunbately, I've seen no sign of a doc.hasCollection() method.
I've found a "collection" property of the doc object in the Javascript for Acrobat API Reference.
I also found the "getDataObject" method for the doc object in the same document.
I became pretty excited when I found this one because if I click the link on that page to dataObjects, it tells me that it's an array containing all of the named data objects in a document.
If I click from there on the link to "data", it shoots me to the "data" page where I read:
"The following objects, properties and methods support PDF portfolios (also called PDF collections or PDF packages):
app.newCollection, Doc.collection, Collection object, and collectionField object".
Again, I think that I'm on the right track because it mentions the "Collection object" and "Doc.collection" but for the life of me, I can't figure out how to reference these properties in my program.
For instance:
       Dim varColl
        gPDDoc.Open("c:\adobe.pdf")
        jso = gPDDoc.GetJSObject
        varColl = jso.getdataobject.Collection()
tells me that I'm missing a required argument.
If I try something like:
       Dim varColl
        gPDDoc.Open("c:\adobe.pdf")
         jso = gPDDoc.GetJSObject
         varColl = jso.Collection()
Then I get:
"Public member 'Collection' on type '_ComObject' not found."
I'm sorry to be obtuse but I can't figure out how to reference these.
I've followed the examples in the "Programming Acrobat JavaScript Using Visual Basic" document and they all make sense. I just can't seem to get to the "Collection" information.
Any help would be greatly appreciated.
Thanks!

Similar Messages

  • Detect device where pdf is being viewed using adobe javascript

    How can I detect whether a PDF file is being viewed in a Mobile device or PC? Is it possible through Adobe JavaScript API or something else?

    Not really a Reader question but more of an advanced Javascript/HTML question.
    Are you trying to serve up a different pdf depending on what they are using? Something else?

  • Detect whether a Word Document is converted for PDF of typed?

    Can any one please tell me which software I can use to detect whether a Word document is converted for a PDF file or typed from keyboard.

    Hello David, thank you for the reply, it is a nice suggestion you gave. I should ask the question from Microsoft, they must have the answer. I have one more question. I would be very nice if you could help me with that too. Here is the link:
    http://forums.adobe.com/message/4748430#4748430
    Thanks once again.

  • Detect whether capture device in use?

    Hi
    I want to detect whether the capture device in use in JMF.
    I looked at the MediaLocator and CaptureDeviceInfo but I can't see any method to do that.
    There is also no exception class for it?
    So my questions are:
    1) Whether we can detect a capture device in use?
    2) Whether we can free the capture device ( The device is used by another thread or program) or to say take control of it.
    Thank you very much.
    Regards
    K.

    1) Whether we can detect a capture device in use? If you know the media locator of the device, and you attempt to use it while it's in use... you'll get an exception thrown. Not sure which one, but I'd imagine an IOException of some sort...
    2) Whether we can free the capture device ( The device is used by another thread or program) or to say take control of it. You cannot.

  • How do I detect whether a publishing object is connected to the datasocket server or not?

    I have 2 vis which communicate via datasocket. The behaviour of the second vi depends on whether the first vi is running or not, and both vis can be started and stopped independently of each other. I need vi 2 to be able to detect whether vi 1 is running or not. Simple, I thought, I'll have a boolean in vi 1 called Running which is set to True when the vi is running and False when it shuts down. I'll publish that vi to datasocket and have a matching boolean in vi 2 which subscribes to it.
    It doesn't work, because as soon as vi 1 stops, Running disconnects and the matching boolean in vi 2 misses the fact that it got set to False before it disconnected, and just gets stuck in the True state.
    So it seems to me there should be a "Is object connected?" vi or function somewhere, but I can't find it.
    Is there another way to detect whether a vi is running or not? Preferably without using shared globals as I find that quite ugly, in fact I've switched to using datasocket from using shared globals because the latter just seemed like really ugly programming.
    Note: I will have several variants of vi 1 with different names, so I can't just try to open a reference to the vi. That's why I wanted to use a datasocket object; all the versions of vi 1 can have a boolean called Running.

    I found a solution. The subscribing boolean in vi 2 is now in its own little loop that executes every 50ms in parallel to the main program loop.
    In vi 1 there is a delay of 500ms between the publishing boolean being set to false and the vi stopping.
    That way the subscriber boolean has plenty of opportunity to read the False state of the publisher.

  • Adobe AIR - Inconsistencies in detecting whether Adobe AIR runtime is installed

    Hello Flex community,
    I am having issues with detecting whether Adobe AIR is installed  using the following process: http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.html
    Having installed Adobe AIR 1.5, we are at times getting a value of  not installed from the getStatus() function of the air.swf located at  http://airdownload.adobe.com/air/browserapi/air.swf
    Has anyone else faced this issue before? If so, does anyone have any  steps to resolve it?
    Thanks!
    Mauricio

    After doing some more research on the issue, I have found other users encountering the same issue we are:
    http://groups.google.com/group/air-tight/browse_thread/thread/706716c29caf0254
    http://www.flexdeveloper.eu/forums/adobe-air/air-swf%27s-getstatus-method-mistakenly-retur ns-%27available%27-when-air-is-installed/
    http://forums.adobe.com/thread/435935
    In the second thread, it says:
    “My issue seems to be specifically related to the use of "Silent Install". My client has a distribution license for the AIR runtime and is bundling the AIR installer with their installer. When Silent Install is used to install the AIR Runtime, Adobe's air.swf reports that the runtime is not installed. This happens until the user initiates an air app, at which point air.swf is able to detect the runtime installation.””
    This seems to suggest there is a bug with the Silent Installer or with the air.swf getStatus function. I tried the steps above and was able to recreated and resolve the issue. Does anyone else know of a different workaround?

  • What's the best way to save an 8.5 x 11 image for use as a page background in a PDF?

    What's the best way to save an 8.5 x 11 image for use as a page background in a PDF? My goal is to have a relatively small final .pdf file size that includes numerous pages with full 8.5 x 11 images as backgrounds in the document. If I save at 8.5 x 11 and 72dpi (example), the image is not 8.5 x 11, and the quality is not good enough. I need help with size, dpi, and file format to save as before I place it in InDesign and then save as a .pdf.
    Thanks,
    Jim

    Do exactly what I said then.  Create the InDesign document of the required dimension, and chose whether it will be high quality print, or Interactive PDF.  It really doesn't mater what format you bring the image into that document.  It can be JPG, PNG, but I usually use native Photoshop PSD.  The image does have to be of high enough resolution, but it can be many times bigger than iis required for the final export.  (InDesign does not import the image, but rather references it on your hard drive.)
    When you have placed your text and finished your page, then export it to PDF, but go through the tabs chosing suitable settings.  If the image needs to be downsized, InDesign will do that at this stage while building the PDF.
    If you can tell us how this presentation will be made (Projector, overhead projector, printed page etc. or just emailed to the end users) we can help you more with the final output settings. 

  • How to detect whether browser's java script  disabled or not from server

    How to detect whether browser's java script disabled or not from server side

    I would use a hidden parameter created by a javascript. if this is null, javascript is disabled...

  • Detecting password protected PDFs in arcobat

    Hello.
    I have a large database of PDF files. And i want to know if there is a function in acrobat to detect password protected PDF's
    without the use off (modified)scripts.
    I'm currently using AAX.
    Thanks in advance.

    Are you talking about passwords to prevent opening the file, or passwords to restrict permissions (printing, etc.)?
    You can detect both types of password with Preflight Droplets in Acrobat Pro:
    Create a new Preflight Profile, and set it to check for encryption and report that property as an error.
    Convert the Profile into a Droplet using the Preflight options menu.
    Set the droplet to move the files to success and error folders of your choice.
    Run the droplet against your candidate files (drag and drop files or folders onto the icon).
    The following will happen:
    Files with no passwords will be placed in the success folder.
    Files with only a permissions (owner) password will be placed in the error folder.
    Files with an open (user) password will be left in their original location*.
    *Unlike scripts, Preflight Droplets do not generate any password dialogs - if they cannot open a file, it is silently ignored.

  • How Can I Detect Whether the User's Firefox Supports MHTML?

    Is there a browser capability property that I could look at to detect whether the user's version of Firefox (including, for instance, an "unMHT" add-on) supports MHTML? Currently we provide reports to our users in this format and want to provide a link to add-on's in case the user cannot actually view the format; but show the report if the add-on or capability is present.

    Sorry, you can't detect if a user has unMHT installed.
    Have you tested your MHTML files with Firefox and unMHT? <br />
    MHTML was never adopted as an official standard by W3C - http://en.wikipedia.org/wiki/MHTML - and from my limited usage of unMHT, it isn't exactly the same as what MS uses with IE. I have had problems displaying a file saved in one browser in another brand browser, and don't remember the specifics beyond IE8 won't correctly display unMHT files even when the file extension is changed from MHT to MHTML. Plus there's a 2nd add-on / extension - Mozilla Archive Format - that some users may have installed for MHTML files.

  • Detecting whether vi has been called or run

        Ok, I must have missed something because I can't figure out how to
    detect whether a VI has been RUN (i.e. is a top-level VI) or has been
    called from another VI. I can get at the "Callers" VI server property
    to see if the array is empty or not, but if any VI that calls the VI in
    question is in memory at all, it gives a false positive. The "First Call?" VI is useless too since it gives a "true" whether the VI is top-level or has been called from some other top-level VI.
    Am I missing something obvious?

    "lanmat" <[email protected]> wrote in message news:[email protected]..
    &nbsp;&nbsp;&nbsp; Ok, I must have missed something because I can't figure out how to
    detect whether a VI has been RUN (i.e. is a top-level VI) or has been
    called from another VI. I can get at the "Callers" VI server property
    to see if the array is empty or not, but if any VI that calls the VI in
    question is in memory at all, it gives a false positive. The "First Call?" VI is useless too since it gives a "true" whether the VI is top-level or has been called from some other top-level VI. Am I missing something obvious?
    Hi,
    The Callers property returns all vi's in memory that call the vi. So that won't work.
    Try the Call Chain function. If there is only one element, the vi (the current run of it) is top level.
    You can also use the property "Execution>State", which returns "Running" or "Running Top Level". But the call chain is easier.
    Remember, if you put the call chain code in a sub vi (you should) you have to check if there are two elements!
    Regards,
    Wiebe.

  • How to use 2 vo's in xml publisher pdf genarate report from oaf--urgent

    Hi Guru's,
    i am integrating xml publisher report from oaf. I found one good artical published by prabaker in apps2fusion site and i implemented the same. But it is used onley one view object to generate pdf. But in my case i want to use 4 view objects to generate report as pdf. So, kindly suggest me how to resolve this issue.
    below i mentioned the site name whihc i follwed to implement my requirement.
    http://apps2fusion.com/at/51-ps/260-integrating-xml-publisher-and-oa-framework.
    pls help me as i am not getting , how to solve this issue.
    Thanks in advance.
    Keerthana

    Hi,
    When we develop simple XML report also we used to get single data source either generated either from RDF or PL/SQL, in OAF XML data is coming from VO and XML Publisher API’s will process that data.
    This approach works fine if you are having one VO, but if you are having two VOs then it is not possible (As per my understanding and comparing this scenario with simple XML publisher report).
    I also faced same problem few months back, on my form I was having two VOs one for header and other for Lines and I have generate Report to show the data for both Headers and Lines. In my case I created a separate VO that was containing both Header and Line details and I was passing header Id to query that. I used query this VO only when someone clicks on “Print” button and it worked fine for me.
    Regards,
    Mahesh B.

  • I am using CC adobe Acrobat to combine multiple pdfs and add page numbers. Mac users can no longer read the page numbers but pc users can.

    I am using CC adobe Acrobat to combine multiple pdfs and add page numbers. As of about 2 weeks ago the mac users can no longer read the page numbers they get a font error message and see only -- where the page information should be. The pc users do not have this same problem. When I replace our regular font (URW Grotesk) with a system font (Verdana) everyone is able to read the page numbers. This is a new issues, I have been creating these documents in the same way for years without a problem. I have been on hold and on and off calls for the last two hours, I keep getting hung up on once I find someone in adobe support to talk to!

    Hi KnoopL,
    Are the Mac users using Preview to view the pdfs or Adobe Reader?
    Regards,
    Rave

  • Help - "Acrobat is being used by another application and cannot open PDF files until the other application is closed."

    Hello,
    I searched this site and google for this error terminology and come up dry.  I support a user who has been for years using Acrobat 5 (yes, I know...) to read files in a client DB program, as well as other PDF files on their PC.  In the last week or so, they have started gatting this error "Acrobat is being used by another application and cannot open PDF files until the other application is closed." any time they attempt to open a PDF file attached to an email (via Outlook).
    It is my understanding that they cannot upgrade to a newer version of Acrobat because of limitations of their client software, but had not previously had any issues viewing PDF notes from the DB, and PDF attachments in their email.
    I have tried uninstalling and re-installing, as well as tried using Adobe Reader 7 & 9 in conjunction with Acrobat to try to get around this issue, but have not been successful.
    Any ideas?
    Thanks,
    Jesse

    I don't have an answer to your technical problem. The product I assume is Acrobat that you are talking about (based on the post title), Adobe is the company name. This is a good place to ask questions on Acrobat if folks can figure out what you are talking about. They will ask for the product version number (like AA9.3.3), operating system, and other applications if appropriate. Also, just what you are doing that generates the message.
    As for Adobe, you are not likely to get an answer from them here in the user forum. You will be lucky if you can get an answer if you can contact them and not be on hold for more than an hour (sorry, this is why a lot of folks end up in the forum).
    So, to help others try to answer your question, what are the products and versions involved? What OS? What are you doing when the message comes up.

  • How To Execute an Oracle 10g SProc using VS 2005, for Reporting Services

    Good day! :-)
    Anybody who knows the syntax for executing an Oracle Stored Proc thru ODBC connection using VS 2005 for Reporting Services? I am having a problem about this.
    I am using the ODBC connection because VS 2005 does not support Oracle Database 10g in its Oracle Database Connection feature (only 7.3, 8i, and 9i), that's y.
    While using MS SQL Server 2000, I never encountered any problem. But using Oracle Database 10g, I find it hard to call the stored procedures, an error is generated everytime.
    Please click the link below for the screenshots:
    http://www.geocities.com/vrcode2/oraError.JPG
    http://www.geocities.com/vrcode2/storedProc.JPG
    Please help...thank you so much.
    Francis

    I'll give you updates about the use of the MS SQL Server Reporting Services with VS 2005 and Oracle, this might be helpful for those who will encounter this same ctuation in the future.
    I have discovered that if you're going to connect thru ODBC, even if the connection is successful, the user is still prompted to input a password, which should not be the case when using the Reporting Services. Another thing to take note is the issue about REF CURSOR, we're going to have problems with this. And also the syntax on how you're going to call the stored procedures (with or without input parameters).
    With modifications made through Oracle Net Manager, and I tried AGAIN connecting through "Oracle (client)" feature of VS 2005 (even if the list only include Oracle 7.3, 8i, and 9i that are supported) with some changes also, you'd still be able to generate correct data with that solution. If the configuration is correct, you just need to call the stored procedure (with or without input parameter), you won't have any problems about the correct syntax.
    I suppose VS 2005 was released earlier than Oracle 10g, that's why 10g wasn't included If ever u'd encounter the same ctuation like mine, and u need the details on how to connect, do not hesitate to ask me.

Maybe you are looking for

  • Help with images and buttons

    I was wondering if anyone could recommend a tutorial or point me in the right direction. I've been trying to figure out how to use buttons to add images (been using png from photoshop with alphachannel) to a canvas. I don't have any problems skinning

  • Nikon D40x Lightroom Problem

    I have also posted this message in the ACR and Bridge Forums: I am running Windows Vista and CS3 and am trying to process Nikon D40x raw files (NEFs) using ACR 4.1. The images come up properly in Bridge. However, when I try to add metadata using a me

  • How to disable browser back/forward buttons from JSF

    Hi, I am working on one JSF based project I have a requirement where I don't want the application users to go back/forward using browser back/forward buttons so I want to disable the browser's back/forward buttons for my application. Can anyone tell

  • How to turn off autoplay in iPod app on an iPad

    Hi Everyone, I want to use my new iPad as a backing track player for my duo cover band. We've been doing this for months with my MBP and you can just uncheck each song in a playlist to keep iTunes from automatically playing the next song in the playl

  • Inserting or Updating a row, Depending on Condition in Procedure

    Hi All, I m new to Procedures in Oracle. Can some body help me out? I need to insert a row, if there is no row exist for a user. And update, when the record exist. here are the fields of table: EMPLOYEE_ID, VALUE1, VALUE2, CREATED_DATE, UPDATED_DATE,