Get-process and UserName

Hi,
I'm trying to list all/some process and need to include the username since the script has to run in a terminal server environment. It works using WMI (Get-WmiObject Win32_Process and GetOwner()) but get-process provides some more attributes I need to export to  a logfile.
Accoring to MSDN there is a property called UserName in the StartInfo object, but the value is always empty, when executing this script:
get-process
outlook | select-object id, path, @{Name="UserName";Expression = {$_.StartInfo.UserName}}
What's wrong? I am fairly new to PS, so is this the correct way of reading that property?
Thanks, regards

This is fantastic.  My question is how i would take the same code but add an exclusion for the owner of the process.  ( ie: delete all *.exe processes whose owners are not equal to "string = x,y,z" or "array[x,y,z]" )
For instance.  We have an erp system that creats a *.exe file for each logged on user.  Our problem is that we have users that do not properly log off the sytem thus resulting in a hanging session and max users reached errors. 
At the current time i manually delete these sessions but would like setup an automated process to clear these sessions every evening.  There are about 12 of these sessions that we do not want to delete as they are more of a system process that we wish
to keep running.
Any help or direction would be much appreciated!

Similar Messages

  • Issues with Get-Process and Format-List

    Hi everyone, first post here, trying to work something out. I'm teaching myself how to code both for work and for fun. Trying to make up a little tool for work to streamline users generating helpdesk tickets and allowing us to capture more data easier.
    This is the line that's giving me trouble:
     $runningprocess = Get-Process | select ProcessName | format-list
    When I run that in the Powershell ISE window I get this:
    ProcessName : armsvc
    ProcessName : audiodg
    ProcessName : CcmExec
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : chrome
    ProcessName : CmRcService
    ProcessName : communicator
    ProcessName : concentr
    ProcessName : conhost
    ProcessName : csrss
    ProcessName : csrss
    ProcessName : explorer
    ProcessName : hkcmd
    ProcessName : Idle
    ProcessName : iexplore
    ProcessName : iexplore
    ProcessName : igfxpers
    ProcessName : igfxsrvc
    ProcessName : igfxtray
    ProcessName : lsass
    ProcessName : lsm
    ProcessName : notepad
    ProcessName : notepad
    ProcessName : OUTLOOK
    ProcessName : powershell_ise
    ProcessName : PresentationFontCache
    ProcessName : RAVCpl64
    ProcessName : services
    ProcessName : smss
    ProcessName : spoolsv
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : svchost
    ProcessName : System
    ProcessName : taskhost
    ProcessName : taskhost
    ProcessName : wininit
    ProcessName : winlogon
    ProcessName : WmiPrvSE
    ProcessName : WmiPrvSE
    ProcessName : WmiPrvSE
    ProcessName : WmiPrvSE
    ProcessName : WmiPrvSE
    ProcessName : WmiPrvSE
    But when it gets placed into the email it comes out like this:
    Running Processes: Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Microsoft.PowerShell.Commands.Internal.Format.GroupStartData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.GroupEndData
    Microsoft.PowerShell.Commands.Internal.Format.FormatEndData
    It gets put into the email like this:
    $emailbody = @"
    Username: $currentUser<br><br>
    Hostname: $hostname<br><br>
    IP Address: $ipaddress1<br><br>
    Problem Details: $objTextBox<br><br>
    Running Processes: $runningprocess<br><br>
    Any ideas? 

    Just place it in quotes to see what happens:
     $runningprocess = Get-Process | select ProcessName | format-list
    "$($runningprocess.GetEnumerator())"
    OR
    "$($runningprocess"
    Both do the exact same thing.
    It is the Format-List that screws thing up.  It does not produce text output. It is a collection of objects.  Adding <br> to the end does not add line breaks to the lines.
    XonvertToHtml is really the only way to get the desired output.  Remeber that HTML does not break a line on a CrLf.
    Try this:
    $p=Get-Process | select name | FL | Out-String
    $html=@"
        <h1>Test table</h1>
        <div>$p</div>
    $html>test.html
    .\test.html
    You can easily see that it doesn't work.  The assummption about GetEnumerator is misapplied because it is not a hash table and it is not text.
    $p=Get-Process | select name | FL
    PS C:\scripts> $p.GetType().Name
    Object[]
    PS C:\scripts> $p|%{$_.GetType().Name}
    No hash tables.  No strings.
    ¯\_(ツ)_/¯

  • Can you get userid and username from OID through sqlplus?

    Anyone know where the user information stored in OID, I mean which table and schema. Thanks!

    Yes you could, but the query would be difficult. LDAP which has a tree-like structure is stored in relational tables. So, in order to get the data you will need to poke into tables in the ODS schema of the metadata repository.
    Have a look at ods.ct_dn and ods.ds_attrstore.
    But take my advice and stick to ldap commands. You can also use the dbms_ldap package from pl/sql.
    cu
    Andreas

  • I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted!

    I tried to install yosemite yesterday and my computer goes through the whole installation process and then to a blank white screen.  I've rebooted, I've reinstalled several times and get the same result.  Two days wasted and I can't use my computer!!

    I don't know if you've already resolved your problem, but I had the same thing, it took me 6 hours to fix it. I had the exact same as you, installed the update and then it went to a white screen. After trying start up holding down cmmd r or holding down the alt key to try to install it again, nothing worked, same result every time. Then an angel came to me here somewhere but I can't find it now to thank him. Start in safe mode, press shift once you hear the start up chime and hold it down until you hear it again. Installation completion box came up and it was working. turn off computer and start up again normally and all is well. Except my final cut pro x doesn't work with it, have to update that now too. same as when I updated to mavericks.
    Hope this helps.

  • The Command Get-ADUser -Identity username -Properties * No Longer Works Due to a Bug in PowerShell 4 and Win8-1 Pro

    The 'Command Get-ADUser -Identity <username> -Properties *' No Longer Works Due to a Bug in PowerShell 4 and Win8-1 Pro
    It produces the following error:
    Get-ADUser : One or more properties are invalid.
    Parameter name: msDS-AssignedAuthNPolicy
    At line:1 char:1
    + Get-ADUser -Identity ********** -Properties *
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (**********:ADUser) [Get-ADUser], ArgumentException
        + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentException,Microsoft.ActiveDirectory.Management.Commands.GetADUser
    This is already documented in these forums:
    1. http://social.technet.microsoft.com/Forums/systemcenter/en-US/1bf9568e-6adc-495d-a37c-48877f86985a/powershell-40-and-the-activedirectory-ps-module?forum=w81previtpro
    2. https://connect.microsoft.com/PowerShell/feedback/details/806452/windows-8-1-powershell-4-0-get-adcomputer-properties-bug
    Unfortunately, in typical style, Microsoft have archived number 1 without bothering to respond with advice.  Can someone in Microsoft please advise your customers here if this is being investigated and of any available workaround or fix ?
    -- huddie "If you're not seeking help or offering it, you probably shouldn't be here."

    Did you consider using one of the "workarounds" below to run an existing version of the AD Module for PowerShell under a specific PowerShell version:
    a. #require -version 3.0    (in ps1 script)
    b. powershell -version 3.0
    Thank you for sharing with us if this helps.
    Desmond, did you miss my reply below ?  I still haven't heard back from you:
    >> "Desmond,
    >> 
    >> Thanks for your quick response.
    >> 
    >> I'm running this just as a command, not in a script:
    >> 
    >> Get-ADUser -Identity <username> -Properties *
    >> 
    >> When I try to run powershell
    -version 3.0 first, then run the above command, it still fails with the same error.  When I then run Get-Host,
    the version still shows as 4.0 so maybe there's more I need to do to launch a 3.0 host.  Anyway, from what I've read it seems your command is more aimed at script compatibility.
    >> 
    >> Can you help ?"
    -- huddie "If you're not seeking help or offering it, you probably shouldn't be here."

  • HT4796 When I run migration assistant on my PC, I get a message saying windows mail is running and won't let me proceed.  Windows Mail is not running. I checked Task Manager's applications, services and processes and found no references to Window's Mail.

    Got a new iMac 27" for Christmas (well a little after) and tried using Migration Assistant to transfer some files.  I can't get past a window on the PC that pops up indicating Quit Other Programs  Before you can transfer your information, the following programs must be shutdown:  Windows Mail  Close these programs and run Migration Assistant again.  If these programs do not appear to be running, restart your computer and try again.
    I've rebooted.  I've searched Task Manager - Applications, Processes and Services and there are no references to WMail.  I don't or haven't knowingly used Windows Mail and Outlook isn't even installed on my PC.  Does anybody know how to get around this without using external drives, USB flashdrives, etc.

    Lots of fun.... The superdrive in my Macbook seems to have gone off kilter since my install. Now the CD-R won't work regardless of which operating system I use. Normal CD's and DVD's are fine, but any CD-R is taken as a blank disk.
    Using an external CD drive solved this problem.

  • I am downloading the Creative Cloud desktop app on my Mac, and it starts to download but just stalls in the process and doesn't get any closer to finishing. Anyone have any suggestions. I've restarted my computer multiple times and restarted the download,

    I am downloading the Creative Cloud desktop app on my Mac, and it starts to download but just stalls in the process and doesn't get any closer to finishing. Anyone have any suggestions. I've restarted my computer multiple times and restarted the download, but to no avail.

    uninstall anything cc that's already installed, clean (Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6) and the reinstall, Adobe: Creative, marketing, and document management solutions

  • ALE Change pointer BDCPS table gets processed again and again

    Hello,
    In Test system, when we run BD21 for DEBMAS, same change pointers getting processed again and again. This did not happen in Dev.
    We did client copy for building Test system from DEV  (Gold client).
    Is it possible to carry over few table entries from Dev (even though it is gold client) and these entries cauing aboev problem while runnign BD21?
    Is there any way to get rid of it? Will BD22 help?
    Thanks.
    Rupali.

    >
    Rupali K wrote:
    > Hello,
    >
    > In Test system, when we run BD21 for DEBMAS, same change pointers getting processed again and again. This did not happen in Dev.
    > We did client copy for building Test system from DEV  (Gold client).
    >
    > Is it possible to carry over few table entries from Dev (even though it is gold client) and these entries cauing aboev problem while runnign BD21?
    >
    > Is there any way to get rid of it? Will BD22 help?
    >
    > Thanks.
    > Rupali.
    Hi Rupali.
    BD22 is used for erase change pointers. Why don't use WPMU ? or WPMA ? Using transaction WPMU, this
    take change pointers, and mark it like processed. I'm using WPMU, and it's  working.
    Regards.

  • Get process id and task id for long-lived process?

    Scenario:
    I have created a long-lived process that will assign a task to a user. The user then has two options to Accept or Reject. Accept route saves the data to the database. Reject does not save. 
    I want to invoke this process in .Net and need to know how to get the current task id of the process invoked. I know that invoking the async method returns an invocation id. How do I use this value to get to the current task id of the process?
    I then want to be able to call a method to complete this task outside of workspace. For example, on my form I would have an Approve and Reject button. If user clicks Approve it would choose the approve route in the process and if Reject button clicked it would take the reject route. What would be the API call to do this in .Net that would trigger the appropriate route given the button clicked on the Form?
    Any help would be appreciated.

    Generally, the TaskManager service is used to query tasks. I've not used the wsdl for that service before so I can't help you much there.
    In the process, you can get the taskID if you use a custom render service. To externalize the taskID you'd have to do something like have the render service save the ID to a file, or call a web service and pass it to the service, or use JMS service, or email service.....

  • Process not getting correlated and going into manual recovery stage

    Hi
    I have developed a bpel process which implements correlation. I have unit tested it and is working fine. But am encountering issues in case of load.
    The process which should correlate to the running process is going into manual recovery and the correlation is not happening. Whenever is restart the managed server, and then recover the instance things are getting completed and correlation is happening.
    Can some one suggest what might be the problem in this case
    Thanks in advance

    Sumit,
    This occurs because your process has not dehydrated to the dehydration store yet.
    The process has not failed but it is waiting for a response from some partner link in your BPEL process. This can be common when calling async ESBs and the ESB fails.
    To try and debug this you will need to look at the domain.log and see if any error is generated. Have a look at your BPEL process and see what partner link cal cause a failure yet not send a response back.
    Is the DB adapter the only partner link or are there others?
    cheers
    James

  • Slow processing and getting opening errors/warnings

    I've modified the PDF Binder sample to get a plugin that would open PDF's and Tif files, and save them as PDF/A-1b (code below).
    It's working. The problem: it's processing too slow (compared with the Actions batch processing)... and I've been getting warnings/and errors about "The imput file is corrupt or of an unknown/unsupported type" type. This is stopping my batch process until I click OK, and the it continues.
    I am trying to process a few thousand of tif files now. I tried first to use the Batch processing capability built in the Acrobat X... an it works, but only with the first 255 documents in the folder... then gives an "insufficient disk space" message for the rest of the files in the directory.
    So, 2 questions: Does anyone knows why it is so slow processing the tiff files and... how I can make my code "silent" so it does not wait for the OK after the message??
    Thanks in advance.
    The code:
    ADOBE SYSTEMS INCORPORATED
    Copyright (C) 1998-2006 Adobe Systems Incorporated
    All rights reserved.
    NOTICE: Adobe permits you to use, modify, and distribute this file
    in accordance with the terms of the Adobe license agreement
    accompanying it. If you have received this file from a source other
    than Adobe, then your use, modification, or distribution of it
    requires the prior written permission of Adobe.
      \file PDFBinder.cpp
    - Implements a method to convert multiple files into PDFs and bind the PDFs
    into one PDF file. The code shows how to use AVConversionToPDFHandler to
    convert files to PDF and how to use PDDocInsertPages() to combind PDF files.
    // Headers.
    #include <stdio.h>
    #include <ctype.h>
    #ifndef MAC_PLATFORM
    #include <direct.h>
    #include "PIHeaders.h"
    #endif
    // Defines ----------
    // Define this flag to show AVConversionToPDFEnumHandler info. in log file.
    #define SHOW_TOPDF_HANDLER_TYPES   
    // define this flag to use file type filter 
    #define USE_FILE_FILTER   
        Constants/Declarations
    // Message display control.  Ture: display
    ASBool bEcho = true;
    // File location. User can change the following filenames.
    #if WIN_PLATFORM
        const char* STRING_PDFBinderFolder = "C:\\Fairfax\\Adobe\\in";
        const char* STRING_PDFOutputFolder = "C:\\Fairfax\\Adobe\\PDFA";
        const char* FOLDERSYMBOL="\\";
    #endif
    #if MAC_PLATFORM
        const char* STRING_PDFBinderFolder = "/PDFBinder";
        const char* FOLDERSYMBOL="/";
    #endif
    char* OutputPdfFileName = "PDFBinderOutput.pdf";
    char* LogFileName = "PDFProcessLog.txt";
    static ASInt32 gNumToPDFExt;
    static ASInt32 gNumFromPDFExt;
    static AVConversionFromPDFHandler RightHandler;
    const int MAX_FILENAME_LENGTH = 256;
    char sLogFileName[MAX_FILENAME_LENGTH];
    // Filter -----------
    // Filter is a list of file types which can be converted to PDF in this program.
    // Use a filter may fit user's specific needs and ensure a smooth automation process.
    // Of course, the user can turn off the filter in two ways:
    //   (1) gPDFBinderFileFilter = "";
    //   (2) comment out //USE_FILE_FILTER 
    // The filter should be consistent with the Acrobat viewer's menu capability:
    //   Create PDF from multiple files ...
    // Here we put the types which have been tested, but user can expand it.
    const char* gPDFBinderFileFilter = "pdf,tif,tiff,PDF,TIF,TIFF";
    const int MAX_STRING_LENGTH = 2048;
    AVConversionToPDFHandler gHandler;
    // functions in this file.
    int    ConvertAndInsertFileToPDF(ASPathName aspItem, char* aFileName, PDDoc  PDFfile);
    void BindingFileToPDF(ASPathName aPathName, char* aFilename, ASFileSysItemPropsRec nFileAttrb, PDDoc targetPDdDoc, ASPathName outputPathName, int *ipTotal, int *ipConverted);
    ASBool PassPDFBinderFileFilter(char* filename);
    int    ConvertAndSavePDFInTargetFolder(ASPathName aPathName, char* aFileName, PDDoc PDFfile, ASPathName outputPathName);
    char* NewFileName(char *& aFileName);
    // callbacks
    ACCB1 ASBool ACCB2 MyAVConversionToPDFEnumProc(AVConversionToPDFHandler handler, AVConversionEnumProcData data);
    ACCB1 ASBool ACCB2 AVConversionToPDFEnumFindHandler(AVConversionToPDFHandler handler, AVConversionEnumProcData data);
    static ACCB1 ASBool ACCB2 myAVConversionFromPDFEnumProc(AVConversionFromPDFHandler handler, AVConversionEnumProcData data);
        Implementation
    /**    This sample implements a method to convert multiple files into PDF
      and bind the PDFs into one PDF file .
        This sample shows developers how to grammatically implement To-PDF file
      converson functionality.  Basically, the code uses AVConversionToPDFHandler
      to convert files to PDF and PDDocInsertPages()to combine PDF files.
      This plug-in is designed to run from a menu item, and by setting bEcho = false
      it may be run without any graphics user interface on the screen. Therefore, it 
      can be executed from other programs such as C IAC, VB IAC, and JavaScript
      to meet enterprise workflow needs.
        How to run it :
        - This sample adds a menu item "PDF Binder" under the Acrobat SDK submenu. Two ways to
        execute it: 1) click the menu item to run the program using a fixed file location
        hard coded; 2) press the shift key and click the menu item to choose a folder where
        files to be converted are located.
        - Without folder selection, this original code is to convert and bind files in a
        directory    C\test\PDFBinder for Win, or a folder   MacHD:test:PDFBinder for Mac.
        You can copy the test files in the project's testfiles folder to the appropriate location 
        for testing. You may locate files to be converted in another directory/folder, and
        specify the location in the string variable PDFBinderFolder in the code.
        - When you have the files to be converted ready in the specified location,
        run Acrobat 6 menu Advanced->AcrobatSDK->PDF Binder to start the operation.  There are
        echo messages informing you of the operation start and end, but you can change and
        rebuild the code to turn off the display on screen.
        - An output file PDFBinderOutput.pdf in the same location is created
        when the program succeeds. A text log file  PDFBinderLog.txt in the same
        location records the process and results.
        -  You can set bEch = false in the code to turn off any display on the screen.
        This is necessary when you  call the menu function from within other programs
        of C IAC, VB IAC, JavaScript. 
        -  An optional file filter is used to pre-process the files. The filter only allows
        the files with predefined types to be processed. You can change the file type list
        as you wish. Using a filter may ensure a smooth automation process, since you can put
        only well-tested file types in the filter. To turn off the filter, you can set
        gPDFBinderFileFilter = "" or not to define USE_FILE_FILTER 
        - Note this is a sample only, developers need to make further improvement for
        their actual use. For example, you can set up a list of files to use the method for
        the conversion and binding. And you can add code to handle special file types.
          @see AVConversionConvertToPDFWithHandler
        @see AVConversionEnumToPDFConverters
        @see ASFileSysDestroyFolderIterator
        @see PDDocOpen
        @see PDDocClose
        @see PDDocInsertPages
        @see PDDocCreatePage
        @see PDDocDeletePages
        @see PDPageRelease
        @see ASFileSysCreatePathName
        @see ASFileSysFirstFolderItem
        @see ASFileSysNextFolderItem
        @see ASFileSysGetNameFromPath
        @see ASFileSysReleasePath
    ACCB1 void ACCB2 PDFBinderCommand(void*)
        // if the menu item clicked with Shift key pressed down, go to interactive mode.
        // let the user to choose a folder and process all the file in the folder.
        ASText dispText = ASTextNew();
        char PDFBinderFolder[MAX_STRING_LENGTH];
        ASBool shiftKeyIsDown = ((AVSysGetModifiers() & AV_SHIFT) != 0);
        if(shiftKeyIsDown) {
            AVOpenSaveDialogParamsRec dialogParams;
            // Configure the dialog box parameters.
            memset (&dialogParams, 0, sizeof (AVOpenSaveDialogParamsRec));
            dialogParams.size = sizeof(AVOpenSaveDialogParamsRec);
            dialogParams.windowTitle = ASTextFromScriptText("Choose folder with files to bind",kASRomanScript);
            dialogParams.flags |= kAVOpenSaveAllowForeignFileSystems;
            dialogParams.initialFileSys = ASGetDefaultUnicodeFileSys();
            ASPathName thePath;
            ASFileSys fileSys;
            AVAppBeginModal(NULL);
            if(ASBoolToBool(AVAppChooseFolderDialog(&dialogParams, &fileSys, &thePath)) != true){
                AVAppEndModal();
                //AVAlertNote("Failed to select the folder");
                return;
            AVAppEndModal();
    #ifdef WIN_PLATFORM       
            ASFileSysDisplayASTextFromPath(ASGetDefaultUnicodeFileSys(), thePath, dispText);
            ASHostEncoding bestEnc = ASTextGetBestEncoding(dispText, (ASHostEncoding)PDGetHostEncoding());
            strncpy(PDFBinderFolder, ASTextGetEncoded(dispText, bestEnc), MAX_STRING_LENGTH - 1);
    #else       
            ASPlatformPath aspPath;
            ASFileSysAcquirePlatformPath(fileSys, thePath, ASAtomFromString("POSIXPath"), &aspPath);
            strncpy(PDFBinderFolder, (char *)ASPlatformPathGetPOSIXPathPtr(aspPath), MAX_STRING_LENGTH - 1);
            ASFileSysReleasePlatformPath(fileSys, aspPath);
            // remove extra path separator
            char e = PDFBinderFolder[strlen(PDFBinderFolder)-1];
            if(e == ':' || e == '/')
                PDFBinderFolder[strlen(PDFBinderFolder)-1]='\0';
            dispText = ASTextFromScriptText(PDFBinderFolder, kASEUnicodeScript);
    #endif
            ASFileSysReleasePath(fileSys, thePath);
        // Otherwise, the hard coded file path will be used.
        else {
            strcpy(PDFBinderFolder, STRING_PDFBinderFolder);
            dispText = ASTextFromScriptText(PDFBinderFolder, kASRomanScript);
        // instruction message
        char strMsg[MAX_STRING_LENGTH] = "";
        sprintf(strMsg, "This function will convert and process Tiff and PDF files in the selected directory. ");
        strcat(strMsg, " You need to copy your files in C:\\Fairfax\\Adobe\\in directory." );
        strcat(strMsg, " Files will be processed into C:\\Fairfax\\Adobe\\PDFA directory." );
        strcat(strMsg, " If you are ready, click OK to continue, or click Cancel to quit. " );
        strcat(strMsg, " \nNote you can press down Shift key and click the menu item to have a folder selection. " );
        strcat(strMsg, " \nNote you can turn off the echo message by setting bEcho = false and rebuild the code. " );
        if(ASBoolToBool(bEcho)==true){
            ASInt32 choice = AVAlert(ALERT_CAUTION, strMsg, "OK", "Cancel", NULL, true);
            if(choice==2) {
                return;
        // create a new target pdf file with one empty page
        PDDoc TargetPDF = PDDocCreate();
        ASFixedRect mediaBox = { fixedZero, ASInt32ToFixed(792), ASInt32ToFixed(612), fixedZero };
        PDPage emptyPage = PDDocCreatePage (TargetPDF, PDBeforeFirstPage, mediaBox);
        PDPageRelease (emptyPage);
        //     get available headlers and set our file filter
        char ValidExt[MAX_STRING_LENGTH];
        memset(ValidExt, 0, MAX_STRING_LENGTH);
    #ifdef SHOW_TOPDF_HANDLER_TYPES   
        // enumerate AVConversioToPDF handlers to get all available file
        // types which can be converted to PDF.
        AVConversionEnumToPDFConverters(MyAVConversionToPDFEnumProc, (AVConversionEnumProcData) ValidExt);
        //AVAlertNote("Converters Defined");
        //AVAlertNote(ValidExt);
        //AVAlertNote(gPDFBinderFileFilter);
    #endif
    #ifdef USE_FILE_FILTER    
        // set File filter
        strcpy(ValidExt, gPDFBinderFileFilter);
        //AVAlertNote(ValidExt);
    #endif
        // process all files in the directory
        int iNumFiles = 0;
        int iNumFilesConverted = 0;
        char* Done = "Converted";
        char* NotDone = " - ";
        char fileName[MAX_FILENAME_LENGTH+1];
        ASFileSysItemPropsRec props;
        ASFolderIterator iter;
        ASPathName aspItem = NULL;
        memset(&props, 0, sizeof(props));
        props.size = sizeof(props);
        //AVAlertNote("Props Defined");
        ASPathName theFolder = NULL;
        ASFileSys fileSys = NULL;
        DURING
    #ifdef WIN_PLATFORM   
        fileSys = ASGetDefaultFileSysForPath(ASAtomFromString("ASTextPath"), dispText);
        theFolder = ASFileSysCreatePathName (fileSys, ASAtomFromString("ASTextPath"), dispText, 0);
        //AVAlertNote("FileSys and Folder Defined");
    #else
        fileSys = ASGetDefaultFileSysForPath(ASAtomFromString("POSIXPath"), PDFBinderFolder);
        theFolder = ASFileSysCreatePathName (fileSys,
                                ASAtomFromString("POSIXPath"), PDFBinderFolder, 0);
    #endif
        if (theFolder==NULL) {
            //AVAlertNote("Fail to create ASPathName for the selected folder.");
            E_RTRN_VOID
        // Find first file in current directory
        if((iter = ASFileSysFirstFolderItem(fileSys, theFolder, &props, &aspItem))==FALSE) {
            //AVAlertNote("This is either an invalid folder or the folder contains no files.");
            E_RTRN_VOID
        ASFileSysReleasePath(fileSys, theFolder);
        //AVAlertNote("Folder Released");
        // get filename only
        if(ASFileSysGetNameFromPath(fileSys, aspItem, fileName, sizeof(fileName))) {
            E_RTRN_VOID
        HANDLER   
            // exception handling
            char errorMsg[256];
            ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
            if(aspItem!=NULL) ASFileSysReleasePath(fileSys, aspItem);
            if(theFolder!=NULL) ASFileSysReleasePath(fileSys, theFolder);
            // display an error message.
            if(ASBoolToBool(bEcho)==true) {
                AVAlertNote (errorMsg);
            return;
        END_HANDLER
        //AVAlertNote(fileName);
        // go to binding if it's a valid type of file
        if(props.type == kASFileSysFile && PassPDFBinderFileFilter(fileName)) {
            char outFileName[] = "";
            //strcat(outFileName, STRING_PDFOutputFolder);
            //strcat(outFileName, FOLDERSYMBOL);
            //strcat(outFileName, fileName);
            strcat(outFileName, STRING_PDFOutputFolder);
            strcat(outFileName, FOLDERSYMBOL);
            strcat(outFileName, fileName);
            //AVAlertNote(outFileName);
            ASPathName outputFileName = ASFileSysCreatePathName (ASGetDefaultFileSys(), ASAtomFromString("Cstring"), outFileName, 0);
            BindingFileToPDF(aspItem, fileName, props, TargetPDF, outputFileName ,&iNumFiles, &iNumFilesConverted);
            //AVAlertNote("File Processed");
        ASFileSysReleasePath(fileSys, aspItem);
        // process all other files 
        while(ASFileSysNextFolderItem(fileSys, iter, &props, &aspItem)) {
            // get filename only
            if(ASFileSysGetNameFromPath(fileSys, aspItem, fileName, sizeof(fileName))) {
                return;
            // go to binding if it's a valid type of file
            if(props.type == kASFileSysFile && PassPDFBinderFileFilter(fileName))  {
                char outFileName[] = "";
                //strcat(outFileName, STRING_PDFOutputFolder);
                //strcat(outFileName, FOLDERSYMBOL);
                //strcat(outFileName, fileName);
                strcat(outFileName, STRING_PDFOutputFolder);
                strcat(outFileName, FOLDERSYMBOL);
                strcat(outFileName, fileName);
                //AVAlertNote(outFileName);
                ASPathName outputFileName = ASFileSysCreatePathName (ASGetDefaultFileSys(), ASAtomFromString("Cstring"), outFileName, 0);
                BindingFileToPDF(aspItem, fileName, props, TargetPDF, outputFileName, &iNumFiles, &iNumFilesConverted);
                //AVAlertNote("File Processed");
            ASFileSysReleasePath(fileSys, aspItem);
        ASPathName pdfPathName = NULL;
        DURING
        // close the findfile
        ASFileSysDestroyFolderIterator(fileSys, iter);
        // save and close the output pdf file
        // create path
        ASText pathText = ASTextNew();
        ASTextCatMany(
            pathText,
            dispText,
            ASTextFromScriptText(FOLDERSYMBOL, kASRomanScript),
            ASTextFromScriptText(OutputPdfFileName, kASRomanScript),
            NULL);
    #ifdef WIN_PLATFORM
        ASFileSys fileSys = ASGetDefaultFileSysForPath(ASAtomFromString("ASTextPath"), pathText);
        pdfPathName = ASFileSysCreatePathName (fileSys,
                                ASAtomFromString("ASTextPath"), pathText, 0);
    #else
        char path[MAX_STRING_LENGTH];
        strncpy(path, ASTextGetEncoded(pathText,
            ASTextGetBestEncoding(pathText, (ASHostEncoding)PDGetHostEncoding())), MAX_STRING_LENGTH - 1);
        ASFileSys fileSys = ASGetDefaultFileSysForPath(ASAtomFromString("POSIXPath"), path);
        pdfPathName = ASFileSysCreatePathName (fileSys,
                                ASAtomFromString("POSIXPath"), path, 0);   
    #endif
        if(pdfPathName==NULL) {
            E_RTRN_VOID
        // delete the empty page
        if(PDDocGetNumPages(TargetPDF)>1) {
            PDDocDeletePages (TargetPDF, 0,0,NULL, NULL);
        // save
        //PDDocSave (TargetPDF, PDSaveFull | PDSaveCollectGarbage | PDSaveLinearized,
        //            pdfPathName, ASGetDefaultUnicodeFileSys(),    NULL, NULL);
        PDDocClose (TargetPDF);
        //ASFileSysReleasePath(fileSys, pdfPathName);
        HANDLER   
            // exception handling
            char errorMsg[256];
            ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
            if(pdfPathName!=NULL) ASFileSysReleasePath(fileSys, pdfPathName);
            // display an error message.
            if(ASBoolToBool(bEcho)==true) {
                AVAlertNote (errorMsg);
            return;
        END_HANDLER
        // use this line to show the massage on screen if you need
        //if(ASBoolToBool(bEcho)==true) {
        AVAlertNote ("Folder Completed. PDF/A Output files generated.");
        return;
    /* ConvertAndInsertFileToPDF
    /** Internal function \n
    ** Convert a file to PDF, then insert it to target PDF file.
    ** @param aFileName IN  char string, filename.
    ** @param PDFfile IN/OUT PDDoc of the target PDF file.
    ** @return 0 if OK, 1 if failed.
    int    ConvertAndInsertFileToPDF(ASPathName aPathName, char* aFileName, PDDoc PDFfile)
        PDDoc tempPDF;
        char* Ext;
        DURING
            // get file extention
            Ext = strrchr(aFileName,'.');
            if(Ext) {
                Ext++;
            else {
                E_RETURN (1);
            // if the file is PDF, open PDDoc
            if(strcmp(Ext,"PDF")==0 || strcmp(Ext,"pdf")==0) {
                tempPDF = PDDocOpen (aPathName, ASGetDefaultFileSys(), NULL, true);
                if(tempPDF==NULL) {
                    PDDocClose(tempPDF);
                    E_RETURN (1);
            // else convert it to PDF
            else
                // let it automatically find right handler for the file and do the job.
                AVConversionStatus stat = AVConversionConvertToPDF
                    (kAVConversionAsyncOkay, //kAVConversionNoFlags
                      aPathName, ASGetDefaultFileSys(), &tempPDF, NULL);
                // check if successful
                if(stat != kAVConversionSuccess) {
                    //AVAlertNote("Cannot convert the file.");
                    E_RETURN (1);
        HANDLER   
            // exception handling
            char errorMsg[256];
            ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
            // display an error message.
            if(ASBoolToBool(bEcho) == true) {
                AVAlertNote (errorMsg);
            return 1;
        END_HANDLER
        // insert new PDF into target PDF
        DURING
            // insert all pages of new pdfc to TargetPDFfile.
            PDDocInsertPages(PDFfile, PDLastPage, tempPDF, 0,
                            PDAllPages, PDInsertAll, NULL, NULL, NULL, NULL);
            PDDocClose(tempPDF);
        HANDLER
             char errorMsg[256];
            ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
            if(ASBoolToBool(bEcho)==true) {
                AVAlertNote(errorMsg);
        END_HANDLER
            if(strcmp(Ext,"doc")==0) {
                char fname[40];
                sprintf(fname,"%s.pdf",aFileName);
                remove(fname);
            return 0;
    /* MyAVConversionToPDFEnumProc
    /** Internal callback function \n
    ** called for every AVConversionToPDFHandler.
    ** get the valid type (file extention) for the conversion. 
    ** @return true.
    ACCB1 ASBool ACCB2 MyAVConversionToPDFEnumProc(AVConversionToPDFHandler handler,
                                                 AVConversionEnumProcData data)
        ASUns16 numFileExt = handler->convFilter.numFileDescs;
        for (int i = 0; i < numFileExt; i++) {
            char* ext = handler->convFilter.fileDescs[i].extension;
            if(strlen(ext)>0) {
                strcat((char*) data, ext);
                strcat((char*) data, ",");
        return true;
    /* this is alternative code to get right conversion handler for a specific file
       to be converted. It works with function AVConversionConvertToPDFWithHandler.
       It's not used now, but kept for user's reference.
    ACCB1 ASBool ACCB2 AVConversionToPDFEnumFindHandler(AVConversionToPDFHandler handler,
                                                 AVConversionEnumProcData data)
        ASUns16 numFileExt = handler->convFilter.numFileDescs;
        for ( int i = 0; i < numFileExt; i++)
            char* ext = handler->convFilter.fileDescs[i].extension;
            if(strlen(ext)) {
                if(!strcmp((char*) data, ext)) {
                    gHandler = handler;
                    return false;
        return true;
    /* BindingFileToPDF
    /** Internal callback function for binding process \n
    ** IN: char* aFilename, ASFileSysItemPropsRec nFileAttrb \n
    **     PDDoc targetPDdDoc, int *ipTotal, \n
    **     int *ipConverted, FILE *logfile \n
    ** OUT: int *ipTotal, int *ipConverted. \n
    void BindingFileToPDF(ASPathName aPathName, char* aFilename, ASFileSysItemPropsRec nFileAttrb, PDDoc targetPDdDoc, ASPathName outputPathName, int *ipTotal, int *ipConverted)
        // ignore system, hidden files, and our target PDF and log file.
        if( nFileAttrb.isHidden 
            || (strcmp(aFilename,".")==0) || (strcmp(aFilename,".." )==0)
            || (strcmp(aFilename,OutputPdfFileName)==0) || (strcmp(aFilename,LogFileName)==0)) {
                return;
        (*ipTotal)++;
        char msg[MAX_STRING_LENGTH] = "";
        char* Done = "Converted";
        char* NotDone = " - ";
        // try to convert and insert it to target PDF file.
        // rc would be 0 for success, otherwise 1.
        int rc = ConvertAndSavePDFInTargetFolder(aPathName, aFilename, targetPDdDoc, outputPathName);
        // if converted
        if(rc==0) {
            (*ipConverted)++;
    /* PassPDFBinderFileFilter
    /** Internal callback function for binding process
    ** @return true if the IN aFilename is a valid file for PDF conversion,
    ** otherwise false.
    ASBool PassPDFBinderFileFilter(char* aFilename)
    #ifdef USE_FILE_FILTER
        // if the filter is empty, any file will pass.
        if(strlen(gPDFBinderFileFilter)==0)
            return true;
        char* Ext = strrchr(aFilename,'.');
        if(Ext!=NULL) {
            Ext++;
            if(strstr(gPDFBinderFileFilter, Ext)) {
                return true;
        return false;
    #else
            // not use filter, any file will pass.
            return true;
    #endif
    /* ConvertAndInsertFileToPDF
    /** Internal function \n
    ** Convert a file to PDF, then insert it to target PDF file.
    ** @param aFileName IN  char string, filename.
    ** @param PDFfile IN/OUT PDDoc of the target PDF file.
    ** @return 0 if OK, 1 if failed.
    int    ConvertAndSavePDFInTargetFolder(ASPathName aPathName, char* aFileName, PDDoc PDFfile, ASPathName outputPathName)
        PDDoc tempPDF;
        char* Ext;
        DURING
            // get file extention
            Ext = strrchr(aFileName,'.');
            if(Ext) {
                Ext++;
            else {
                E_RETURN (1);
            // if the file is PDF, open PDDoc
            if(strcmp(Ext,"PDF")==0 || strcmp(Ext,"pdf")==0) {
                tempPDF = PDDocOpen (aPathName, ASGetDefaultFileSys(), NULL, true);
                if(tempPDF==NULL) {
                    PDDocClose(tempPDF);
                    E_RETURN (1);
            // else convert it to PDF
            else
                // let it automatically find right handler for the file and do the job.
                AVConversionStatus stat = AVConversionConvertToPDF
                    (kAVConversionAsyncOkay, //kAVConversionNoFlags
                      aPathName, ASGetDefaultFileSys(), &tempPDF, NULL);
                // check if successful
                if(stat != kAVConversionSuccess) {
                    //AVAlertNote("Cannot convert the file.");
                    E_RETURN (1);
                else {
                    //change Extension
                    ASText asTmp = ASTextNew();
                    ASFileSysDisplayASTextFromPath(ASGetDefaultUnicodeFileSys(), outputPathName, asTmp);
                    //AVAlertNote(ASTextGetScriptText(asTmp, kASRomanScript));
                    if(strcmp(Ext,"TIF")==0 || strcmp(Ext,"tif")==0){
                        ASTextReplace(asTmp, ASTextFromScriptText(".tif", kASRomanScript), ASTextFromScriptText(".pdf", kASRomanScript));
                    } else {
                        ASTextReplace(asTmp, ASTextFromScriptText(".tiff", kASRomanScript), ASTextFromScriptText(".pdf", kASRomanScript));
                    //AVAlertNote(ASTextGetScriptText(asTmp, kASRomanScript));
                    outputPathName = ASFileSysCreatePathName (ASGetDefaultUnicodeFileSys(), ASAtomFromString("ASTextPath"), asTmp, 0);
        HANDLER   
            // exception handling
            char errorMsg[256];
            ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
            // display an error message.
            if(ASBoolToBool(bEcho) == true) {
                AVAlertNote (errorMsg);
            return 1;
        END_HANDLER
        // Run OCR and Save new PDF into target PDF
        DURING
            //    OCR
            ASAtom cmdName;
            AVCommand cmd;
            cmdName=ASAtomFromString("PaperCapture");
            cmd=AVCommandNew(cmdName);
            ASCab config = ASCabNew();
            ASCabPutInt (config, "UIPolicy", kAVCommandUISilent);       //hide the interface
            if (kAVCommandReady ==     AVCommandSetConfig (cmd, config)) {
                //AVAlertNote("Config Ready");
            ASCab inputs = ASCabNew();
            ASCabPutPointer (inputs, kAVCommandKeyPDDoc, PDDoc, tempPDF, NULL);
            if (kAVCommandReady == AVCommandSetInputs (cmd, inputs)) {
                //AVAlertNote("Input Ready");
            ASCabDestroy (inputs);
            AVCommandStatus status = AVCommandExecute(cmd);
                        //switch (status) {
                        //    case kAVCommandReady :
                        //        AVAlertNote("Not working, but ready to work.");
                        //        break;
                        //    case kAVCommandWorking :
                        //        AVAlertNote("Still working");
                        //        break;   
                        //    case kAVCommandDone :
                        //        AVAlertNote("Done working");
                        //        break;   
                        //    case kAVCommandInError :
                        //        AVAlertNote("In Error");
                        //        break;       
                        //    case kAVCommandNotExecuted :
                        //        AVAlertNote("Command not executed due to lack of objects on which the command to be executed");
                        //        break;
            AVCommandDestroy(cmd);
            //Save
            //PDDocSave (tempPDF, PDSaveFull | PDSaveCollectGarbage | PDSaveLinearized, outputPathName, ASGetDefaultUnicodeFileSys(),    NULL, NULL);
            //ClosePDF
            //PDDocClose(tempPDF);
            //Convert to PDF/A Compliance
            //Select the right handler
            AVConversionEnumFromPDFConverters(myAVConversionFromPDFEnumProc, NULL);
            // do conversion
            AVConversionStatus stat = AVConversionConvertFromPDFWithHandler(RightHandler, NULL, kAVConversionAsyncOkay, tempPDF, outputPathName,  ASGetDefaultFileSys(), NULL);
            // check the returned status and show message
            //if (stat == kAVConversionSuccess)
            //                AVAlertNote( "The PDF/A file was saved in output folder." );
            //else if (stat == kAVConversionFailed)
            //                AVAlertNote( "The PDF/A conversion failed." );
            //else if (stat == kAVConversionSuccessAsync)
            //                AVAlertNote( "The conversion will continue asynchronously." );
            //else if (stat == kAVConversionCancelled)
            //                AVAlertNote( "The conversion was cancelled." );
            //Save
            //PDDocSave (tempPDF, PDSaveFull | PDSaveCollectGarbage | PDSaveLinearized, outputPathName, ASGetDefaultUnicodeFileSys(), NULL, NULL);
            //ClosePDF
            PDDocClose(tempPDF);
            ASFileSysReleasePath(ASGetDefaultFileSys(), outputPathName);
        HANDLER
             char errorMsg[256];
            ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
            if(ASBoolToBool(bEcho)==true) {
                AVAlertNote(errorMsg);
        END_HANDLER
            if(strcmp(Ext,"doc")==0) {
                char fname[40];
                sprintf(fname,"%s.pdf",aFileName);
                remove(fname);
            return 0;
    //Select the appropiate handler for the PDF/A conversion
    static ACCB1 ASBool ACCB2 myAVConversionFromPDFEnumProc(AVConversionFromPDFHandler handler, AVConversionEnumProcData data)
        AVFileFilterRec filter = handler->convFilter;
        ASUns16 numFileExt = filter.numFileDescs;
        char *kUniqueID = handler->uniqueID;
        // go through the conversion handlers to find a handler for PDF extension files and the unique key matches the PDF/A one.
        for  (ASInt32  i = 0; i < numFileExt; i++)
            if  (strlen(handler->convFilter.fileDescs[i].extension)>0)
                // found it, fill in the handler and return false to stop going on.
                if (!strcmp(handler->convFilter.fileDescs[i].extension, "pdf") && !strcmp(kUniqueID,"com.callas.preflight.pdfa")) {
                    RightHandler = handler;
                    return  false ;
        return true;

    There are some options for various APIs to run "kinda silent" - but again, Acrobat is designed for INTERACTIVE use…so "completely silent" isn't really an option.
    As for speed – you'd need to be MUCH MORE specific about where your slow downs are.  Have you profiled?
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Mon, 12 Dec 2011 07:39:08 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: Slow processing and getting opening errors/warnings
    Re: Slow processing and getting opening errors/warnings
    created by FFX-ER<http://forums.adobe.com/people/FFX-ER> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4079175#4079175

  • HT1657 hi ! just rented a movie through an apple tv and it stopped, i cant get it back and when go to check rentals its like in process and nothing is hapening still in process, why is that? can u fix it?

    hi ! just rented a movie through an apple tv and it stopped, i cant get it back and when go to check rentals its like in process and nothing is hapening still in process, why is that? can u fix it?

    Mr. Churchill - First, to answer your last questions:
    Yes, the movie is fully downloaded, all 3.69 GBs.
    No the Apple TV has 127.5 GBs of its 144.63 GBs free.
    Second, I tried turning the Time Capsule WiFi rounter and Apple TV off (for at least two or three minutes, not the usual 10 seconds recommended) and I still could not move the movie.
    Third, I severed the link and set it up again re-synced all 5,103 items back and still when I move the movies to the Apple TV box and Apply it, after 35 seconds it stops the sync and moves it back the the Rented Movies box.
    Though I have set my Apple TV to sync with my MacBook Pro I cannot find a way to connect it to other than shared library, but not the "not shared library" (Is this what the Rented Movies are?). Is what Fletch is talking about int the "Rental Movies not showing up on Apple TV" discussion my problem and a solution?
    Fletsch
    Re: Rental Movies not showing up on Apple TV 
    Mar 4, 2008 1:58 PM (in response to Mark_Mac)
    there are three possibilities: you have not upgraded to version 2.0 or in Summary on the ATV device in iTunes, you should look whether you have it set up to only sync or otherwise disables movie syncing, or you have not paired your Mac to the ATV (on your tv, settings/computers/connect to itunes library - not shared library) 
    MacMini core duo, Mac OS X (10.4.8)
    Or is it something else?

  • HT1766 I haveabout 7 App's that I Need to update. However, when trying tot do so,the message I get is 'Can't download the app' (in Dutch). The app, however, such as Pages, is no longer available. What can I do to complete the updating process and start us

    I haveabout 7 App's that I Need to update.
    However, when trying tot do so,the message I get is 'Can't download the app' (in Dutch).
    The App, however, such as Pages, is no longer opening and can't be used.
    What can I do to complete the updating process and start using the Apps again?

    Download iTunes using the tab at the top of this page. Then run the update with iTunes closed.

  • I keep getting asked for  username and password on both IMAP and Exchange when on 3G network but not Wifi!

    We are having serious issues with one of our Google Apps accounts. We have done everything we can think of to get it to work properly on 3G but for some reason it continually asks for the user's password no matter how many times we enter it. However, it does work on WiFi!!
    The iPhone says "Cannot get mail, the username or password for USERNAME is incorrect."
    This happens on both Exchange and on IMAP accounts. We have deleted the accounts and set them up again several times but to no avail.
    It is also worth noting that I have exactly the same settings on my identical iPhone and have no problems whatsoever so we think it may be something with the google configuration.
    Please help!!

    Try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until the screen blacks out or you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.

  • Ical problem already 3 weeks after the update, get the message every time username or password is incorrect as I do with this password and username in mobileme bowl. now get the message The server responded with \ 'HTTP/1.1 409 Conflict \'. can someone he

    Ical problem already 3 weeks after the update, get the message every time username or password is incorrect as I do with this password and username in mobileme bowl. now get the message
    The server responded with \ 'HTTP/1.1 409 Conflict \'.
    can someone help me

    Ical problem already 3 weeks after the update, get the message every time username or password is incorrect as I do with this password and username in mobileme bowl. now get the message
    The server responded with \ 'HTTP/1.1 409 Conflict \'.
    can someone help me

Maybe you are looking for

  • Deleted calendar items still appearing on iPhone

    Calendar items deleted on the PC (Outlook 2003 or Entourage 2008 - 12.1.7, - both linked to Exchange Server 2007) remain in the iPhone (OS 2.2.1) calendar. I am using wireless Exchange ActiveSync. It was working fine, but has now stopped removing del

  • Blackberry passport cannot connect to win 7 pro device driver software was not successfully installed

    I cannot get my passport to connect to eather of my PC's, one is running Win 7 Pro 64bit, and one is running Win 7 pro 32bit. both pc's give me the same driver error-"device driver software was not successfully installed" i have latest versions of Li

  • App Builder doesn't advance - single edition user

    I have followed directions identified in the following chain with Neil Enns - Adobe but have not be able to be successful in advancing in DPS app builder. Re: Can't advance in DPS App Builder I've completed building my folio and have chosen 'Create A

  • HT1420 Authorize

    I have problem when I want to sync from iTunes to my iphone 5s.I've already authorized my computer from iTunes but when I want to sync again,the error message will appear which says you must authorize your computer and i haven't authorized from anoth

  • Where can I found my all  products register history?

    Hi, I have a two iPod 1G and 2G and iMac. I registered all products... But I cant find my register page... How can I found my all registered product in the Apple website?