Apply Quartz filter to a PDF from command line

Hello
I'm trying to apply a quartz filter to a PDF document via the command line. I know it's possible with Python and there's a script at /Developer/Examples/Quartz/Python/filter-pdf.py that does just that. The problem with this is that the script is Python 2.3 and my OS X 10.5.8 is running Python 2.5 - so I'm getting the error message:
+<Error>: The function `CGPDFDocumentGetMediaBox' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. Please use `CGPDFPageGetBoxRect' instead.+
I don't know Pyton but I checked the file and I grep'ed the Developer folder to see if I can find where CGPDFDocumentGetMediaBox is being used, but no matter what I changed, I didn't manage to get the script working.
So I guess my question is one of the following:
How can I update the developer example to a new, functioning version?
or how do I get rid of the deprecated functions that script is using?
or is there any other way to apply a quartz filter to a PDF via the command line? (I've read that SIPS is able to accomplish this, but I couldn't find out how..)
Thank you for any help!
Cheers

There a quartz filter printer hidden in OS X which makes applying a quartz filter to a PDF file on the command line a piece of cake. This is the syntax:
+/System/Library/Printers/Libraries/./quartzfilter inputfile filterpath outputfile+
So if I wanted to convert big.pdf to small.pdf it would go like this:$
+/System/Library/Printers/Libraries/quartzfilter big.pdf /System/Library/Filters/Reduce\ File\ Size.qfilter small.pdf+
The "Reduce File Size" filter isn't that great though when it comes to reducing the file size for printing. Jerome Colas wrote a nice article about quartz filters though: http://discussions.apple.com/thread.jspa?messageID=6109445&tstart=0
You can also create your own with the ColorSync utility in Mac OS X. A Quartz filter is nothing but an XML, so you could also generate one on the fly if necessary.
Resource: http://macscripter.net/viewtopic.php?id=25916

Similar Messages

  • How to open an online pdf from command-line

    Hi,
    I'm trying to get my application to open a pdf file from an url like http://xxxx.dk/xxx.aspx?CID=xxx
    it work from inside adobe reader so the pdf file is a functionel file, but when i try to open it from command line like: AcroRd32.exe /n /A "pagemode=none" "http://xxxx.dk/xxx.aspx?CID=xxx" i keep getting an error telling me "There was an error opening this document. The filename, directory name, or volume label syntax is incorrect"
    does anyone have an idea of what i need to do? i could also make a public test if someone needs to see the issue "live"

    it works with the browser, so no problems there.. i just wanted the pdf file to open in adobe reader instead of browser window, as it opens from a windows application.. but perhaps i need to look more into merging a embedded pdf viewer in the application instead..

  • Acrobat 9 - Use Optimize PDF from command-line or batch

    one can use the functionality optimize pdf from the command line or a batch script?
    thanks

    I found the solution. With the batch sequence i create the pdf optimization, and use the plug-in Autobatchtool (from the partner evermap) to run this batch from command-line. Thanks for you help

  • Combine two or more pdf as one pdf from command line

    Hi,
    I have to combine two or more pdf file as one pdf file from command line.
    Is it possible.
    Thanks,
    Ansaf.

    Acrobat has a rich SDK, but not using the command line - declared obsolete by Adobe several decades ago (but taking a long time to die). To be fair, implementing thousands of APIs via command line would make for a rather complicated command line. Use OLE. BUT NOT ON A SERVER!!

  • Convert Word 2003 to PDF from command line

    I've had a good look through these forums, but can't get a definitive answer to this question:
    Can I use Acrobat Pro to convert a Word 2003 doc to PDF using the Windows command line?
    We have an automated report generation process which creates a Word doc. This tends to have lots of TIF images so the Word doc can end up being >15MB. The batch process, run from the command line, then converts the doc into a PDF using PDFCreator (http://sourceforge.net/projects/pdfcreator/).
    The problem is that the PDFs are then >15MB, which is too big to email to customers (that's also part of the batch process).
    However, if I take the same large Word doc and save it as a PDF in Acrobat Pro, then the PDF is only about 2MB. So Acrobat is doing some more compression than PDFCreator. I've tried all the options on PDFCreator, but I can't make the PDF as small as the Acrobat version.
    Any idea how I can get Acrobat Pro (or Distiller?) to convert a Word doc to PDF from the command line?
    Thanks,
    Johnny

    > Can I use Acrobat Pro to convert a Word 2003 doc to PDF using the Windows command line?
    No.

  • Generating UDT from command line or C# code

    Hi,
    I want to write an application which is capable of generating UDTs and hence use the newly generated UDTs in C#. Right at the moment I can only generate the classes via the wizard in Visual Studio ("Generate Custom Class.."), but i know that e.g. for C++ it is possible to generate these types from command line - with OTT.
    I appreciate any help, finding a way to automatically generate the user defined types in C# (without manually mapping it).
    BR

    Hi Sathish,
    did you find a solution for this? I am looking for the same thing. I want to write a program(perl, batch script, etc.) which could automatically convert pdf to excel without any manual intervention.
    I have the acrobat javascript which could achieve this, but it can only be executed in arobat consolt.  I need it to be able to get executed in a script to automate the processing.
    thanks
    Warren

  • Launche DDDAUDIT from commande line

    Hi,
    how to Launche DDDAUDIT and SYSAUDIT, Initial alter audit from commande line ?
    Thank you.
    PS Version 8.48.16

    Go to PS_HOME\bin\client\winx86, and run in a DOS prompt window :
    pssqr -CT ORACLE -CD dbname -CA ps_username -CAP password -RP dddaudit -OT 2 -OF 2OT=2 for an output file
    OF=2 for a PDF format file
    That implies you already defined some env variables.
    For more info, just kick pssqr on the OS prompt, you'll get all the options.
    Or you could try to define a icon on your desktop pointing to the PSSQRW.EXE command and define the target as following - maybe the simplest way :
    -ZIF+ps_home_path+\sqr\pssqr.ini -i+ps_home_path+\sqr\ -f+output_directory+ -KEEP -PRINTER:PD
    Nicolas.

  • How to send report output to  two  detinations at a time from command line?

    Hi ,
    how to send my report to two detinations at a time from command line i.e FILE and Mail ?
    i created batchfile in that i mentioned one line for file(DESTYPE=FILE) perpose and another line for mail perpose(DESTYPE=Mail).i don't want to mention to lines.
    i want to send my report out put two destinations at a time insted of running two times.
    thx in advance.....
    raghu

    hello,
    did you try to use distribution for that ? check out the reports distribution facilities available in 6i.
    regards,
    the oracle reports team

  • Error while running a Discoverer Workbook with parameter from command line

    I am trying to run a discoverer report from command line and export the results in xls on to my local machine. I could do it fine for a simple workbook, but if I add a parameter(madatory) to the workbook and run it from command line specifying the parameter value I wanted to run the report for, I do not get any results. Here is the command line I am using.
    dis51usr.exe /connect user/password@database /apps_user /apps_responsibility "System Administrator" /eul EUL_US /open C:\Disco\Test.DIS /sheet Testsheet /parameter Period Jan-07 /export xls C:\Disco\X.xls /batch
    Parameter value is entered in correct format(Jan-07).
    When I removed /batch from this to see if I get any error, Discoverer Desktop opened up, logged in and gets terminated saying 'Oracle Discoverer Desktop has encountered a problem and need to close. We are sorry for the inconvenience.'
    Did anybody come across this issue before?

    Hello,
    If you have a few minutes, Windows is also aborting for me:
    the differences are, my situation is:
    a) am running the command line from a .bat file
    b) am NOT running with parms, want the discoverer query to come up for the user
    c) am running a query from the database
    i am signing in as myself BUT running a query that was created by a generic user called SREG
    c) if i run the .bat file from Windows Explorer, the query opens fine
    d) if i execute the .bat file from within Microsoft Access using the shell command,
    the query opens and then aborts RIGHT BEFORE the parm screen would display
    e) btw, if i modify the .bat file, to run a query from MY database signon, then (d) - running .bat file
    from vb using SHELL command works
    Do you have a ideas as to why (d) does not work? I would be very grateful for your time, tx, sandra
    this is what i posted yesterday, tx: Re: Running Discoverer command line
    tx, sandra

  • VPN Client disconnection from command line

    Hi,
    I want to connect to IPsec VPN on ISA500 by VPN Client (v 5.0.07.0440, the last version, I think), using command line parameters.
    I can connect with the command:
    "%programfiles%\Cisco Systems\VPN Client\ipsecdialer.exe" -c -user myUser -pwd myPassword "MyConnectionEntry"
    but i don't know the command to disconnect from command lines.
    If I do
    "%programfiles%\Cisco Systems\VPN Client\ipsecdialer.exe" -?
    I obtain the list of parameters
    vpngui [-c | -sc [sd] [-user <username>] [-pwd <password> ! -eraseuserpwd]] <connection entry>
    but I don't unterstand what I have to do... I try every combination using -sd parameter (I think means for silent disconnect), but in every case I can only to show VPN interface  without disconnect anything...
    Can anyone help me?
    Thanks

    Prasath,
    This appears to be a data flow issue.  You need to look in the dataflow log file.  Your information indicates the project name is SAMPLES.xml, and the data flow ID is D20091213_014350765.  Look at the data flow log file in
    C:\dqxi\11_7\repository\configuration_rules\runtme_metadata\project_SAMPLES\D20091213_014350765
    Alternatively, you can temporarily replace the transactional reader and writter transforms with their corresonding batch transforms, and run the job from the Project Architect.  Any errors will be displayed in the Running window.
    Paul

  • I can not uninstall Office 2013 from command line

    Hi, I have been stuck for a while trying to uninstall Office 2013 via command line. Installation file was downloaded from Volume Licensing Service Center, Uninstall.xml file for silent uninstallation looks like this:
    <Configuration Product=”ProPlus”>
    <Display Level=”basic” CompletionNotice=”yes” SuppressModal=”yes” AcceptEula=”yes” />
    </Configuration>
    From command line the following will not work:
    setup /uninstall ProPlus /config .\ProPlus.ww\Uninstall.xml
    Error: Setup can not find or validate an installation file. Please try reinstalling Office . . .
    setup /uninstall ProPlus gives me GUI to continue process - it seems /config .\ProPlus.ww\Uninstall.xml part does not work as it should be
    This is very important to me since I used above command line in SCCM 2012 R2 to allow user to uninstall Office 2013 by itself via Software Center. When this failed I tried locally but the error was the same. This should have been trivial task - silent uninstallation
    using .xml file. It is not a rocket science. I am very angry because losing time for something like this is unacceptable for system engineers working with SCCM 2012 R2.

    Hi,
    This error might occurs due to lots of reasons. Where is the installation file stored? If it's stored on a network share, please copy it to your local disk, and then manually run the command again. This way, we'll see if the installation file is the
    problem.
    If issue persists in this case, then this generally means that something wrong with the installation file. Please try to redownload it and then try again.
    Please also make sure that you're executing the command with elevated privileges (run as administrator).
    Regards,
    Ethan Hua
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • How to delete more than one workbook from command line

    Hi, I'd like to delete more than one workbook from command line:
    The following syntax, it doesn't work....but I followed the manual instructions:
    dis51adm.exe /connect eul/eul@uatdb /delete /workbook "ALE_TEST_1, ALE_TEST_2" /eul eul /log D:\Ale\delete.log
    where:
    eul/eul@uatdb: is the db’s schema/user where the EUL is installed;
    /delete "ALE_TEST_1, ALE_TEST_2": is the command to delete the workbooks, specified inside the “” (with the relative path)
    /log D:\Ale\delete.log: is the command to write a log’s file named “delete.log” to track the action     
    The log file says:
    22/4/2008 4:00:26 μμ
    dis51adm.exe /connect /delete /workbook ALE_TEST_1, ALE_TEST_2 /eul eul /log D:\Ale\delete.log
    Document ALE_TEST_1, ALE_TEST_2 not found in EUL.
    Internal EUL Error: ObjectNotFound - Can't find EUL element
    There are 0 eul elements to be deleted.
    Completed deleting eul elements.
    22/4/2008 4:00:29 μμ
    Anyone can tell me how is the right syntax ?
    Thanks in advance
    Alex

    Hi Rod
    I was coming to that conclusion myself but wanted to wait until the other avenues had been exhausted first - aka making sure of the workbook names.
    I checked through all of the command line documentation and read nothing which clearly indicated that only one workbook could be processed at a time, other than the fact that the syntax says workbook and not workbooks, which could be a big clue.
    I think you are right though in that it has to be one at a time, which would be a pain.
    Best wishes
    Michael

  • How to run a 10g report from command line ?

    Good Afternoon,
    Please advise if there is a way to run a 10g report from command line.
    We use 6i right now and our job scheduler runs reports using "D:\ORADEV6I\BIN\RWRUN60.EXE ..." executable in batch mode on a separate server. We plan to migrate to 10g Database, Forms, Reports. Is there a way to keep this functionality and create a "command" to address an report server and run a report?
    Thank you,
    Dmitri

    Steps to take.
    (1.) In command prompt type RWSERVER SERVER=repserver1 to star the rep server.
    (2.) If you get "Javaw.exe The procedure entry point psoasyn could not be located in the dynamic link library orapls10.dll." error do one of the following
            (a.) Type the full name for the server. D:\OracleDevR2\bin\rwserver SERVER=repserver1
                   or, if it does not work
            (b.) Add D:\OracleDevR2\bin to the system env. variable PATH
    (3.) Start OC4j
    (4.) Now you can access the jobs using URL like:
        http://192.161.11.143:8890/reports/rwservlet/showjobs?server=repserver1
          where 192.161.11.143 is your machine's IP address.

  • To run a report from command line, when using jdbc-odbc bridge

    Hi,
    How to run a report from command line, when using jdbc-odbc bridge?
    Usually with tns, we do by "rwrun module=<> userid=<user>/<passwd>@tns".
    with odbc, we do by "rwrun module=<> userid=<user>/<passwd>@odbc:DSN"
    Please specify, what is command line arguments for jdbc-odbc bridge driver?
    Environment : Oracle 9i Report Builder on WinNT
    Database : Sybase
    Regards,
    Ramanan

    Hello Ramanan,
    Report Builder : connect JDBC Query in Report Builder is to through Connection Dialog in JDBC Query Editor. User can use a Sign on parameter (can use, default : P_JDBCPDS or can create new) to connect to JDBC Data Source. Connection once made will be mentioned and will be reused through out Reports Builder.
    JDBC PDS allows user to connect one or more same or different kind of databases.
    While running report through runtime or Server, user can pass the sign on parameter(connection string) value, like any other user parameter.
    Syntax for connection string : <username>/<password>@databaseURL . The syntax of database part of connection string depend on the type of JDBC Driver used to connect to Data Source while designing the JDBC Query. databaseURL refer to the location of the database and its format depend on the JDBCPDS river selected in design time while creating the JDBC Query.
    rwrun eg :
    rwrun report=jdbc_odbc.rdf destype=file desname=output.html desformat=html P_JDBCPDS=scott/tiger@database
    Server eg :
    http://server.com:8888/servlet/RWServlet?server=MyReportServer+report=jdbc_odbc.rdf+destype=cache+desformat=html+P_JDBCPDS=scott/tiger@database
    http :
    Please see ORACLE_HOME/reports/conf/jdbcpds.conf for more information.
    With Regards
    Reports Team

  • Error while running ADF-BC Test Suite from command line

    Hi,
    I have created a separate test project containing the Test Suite for the Model componenet of my ADF-BC  application.
    I need to run this test project separately from jmeter.
    The tests run fine from Jdev, But when I package the test project into a jar and try to run from command line, I get the following error:
    java.lang.NoClassDefFoundError: oracle/jbo/ApplicationModule
            at com.oracle.cs.cap.module.applicationModule.ServiceAMFixture.<init>(ServiceAMFixture.java:36)
            at com.oracle.cs.cap.module.applicationModule.ServiceAMFixture.<clinit>(ServiceAMFixture.java:15)
            at com.oracle.cs.cap.module.view.EntitlementReportDurationViewVO.EntitlementReportDurationViewVOTest.<init>(EntitlementReportDurationViewVOTest.java:11)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at org.junit.internal.runners.JUnit4ClassRunner.createTest(JUnit4ClassRunner.java:72)
            at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:79)
            at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
            at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
            at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
            at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
            at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
            at org.junit.internal.runners.CompositeRunner.runChildren(CompositeRunner.java:33)
            at org.junit.runners.Suite.access$000(Suite.java:26)
            at org.junit.runners.Suite$1.run(Suite.java:93)
            at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
            at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
            at org.junit.runners.Suite.run(Suite.java:91)
            at org.junit.internal.runners.CompositeRunner.runChildren(CompositeRunner.java:33)
            at org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:28)
            at org.junit.runner.JUnitCore.run(JUnitCore.java:130)
            at org.junit.runner.JUnitCore.run(JUnitCore.java:109)
            at org.junit.runner.JUnitCore.run(JUnitCore.java:100)
            at org.junit.runner.JUnitCore.runMain(JUnitCore.java:81)
            at org.junit.runner.JUnitCore.main(JUnitCore.java:44)
    Caused by: java.lang.ClassNotFoundException: oracle.jbo.ApplicationModule
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            ... 27 more
    The Test project jar is created as ADF Library JAR File with Model.jpr as the dependent project. This takes care of project class dependencies
    All the adf library dependencies are added to the manifest file of the Test Project jar referring to a location lib/ in the jar file directory.
    I tried creating the ApplicationModule using both Configuration class (Configuration.createRootApplicationModule) as well as using the JDBC Connection String but both fail when I run the test cases independently from jmeter.
    Anybody came across such an error? Please help.
    Thanks,
    Sapna

    Hi Timo,
    Im using JDev version 11.1.1.6.0.
    I checked the class path on the jdev console. All the library references are mentioned in the manifest.mf classpath of the test project like below:
    Manifest-Version: 1.0
    Class-Path: lib/identitystore.jar
    lib/adfm.jar
    lib/groovy-all-1.6.3.jar
    lib/adftransactionsdt.jar
    lib/adf-dt-at-rt.jar
    lib/adfdt_common.jar
    lib/adflibrary.jar
    lib/xmlparserv2.jar
    lib/db-ca.jar
    lib/jdev-cm.jar
    lib/ojmisc.jar
    lib/commons-el.jar
    lib/jsp-el-api.jar
    etc...
    So I expect the library references should be resolved looking at the manifest file.
    Another set of entries that I see in the jdev classpath are related to the Model project which is under test.
    -classpath
    D:\CurrentProject_1\16_7_2013_3pm\11_7_2013\.adf;
    D:\CurrentProject_1\16_7_2013_3pm\11_7_2013\Model\classes;
    How do I put these entries into my class path? Will it be sufficient if I add the Model.jar into my test project classpath?
    Thanks,
    Sapna

Maybe you are looking for