PDF to TIFF using VB.NBET Error: UnsupportedValueError: Value is unsupported. === Parameter cConvID

I'm trying to use the following VB function to transform a pdf
document to a tiff one:
I am using Visual Studio 2008, VB.Net
Using the following code, But when I type
'JSObj.SaveAs(fullPathTIF, "com.adobe.acrobat.tiff")'
Visual studio intelisence doesn't show the SaveAs method at all. I went ahead and typed it, but got the following error in that line
Error: UnsupportedValueError: Value is unsupported. ===> Parameter cConvID
I tried googling forvthat error, but could not find a solution. Please help.
I am trying to do a proof of concept to my client saying that Adobe acrobat could help them convert PDF to TIFF and Tiff to PDF and they are ready to buy the product if I prove that in the .Net environment.
CODE:
=====
http://forums.microsoft.com/msdn/showpost.aspx?postid=1665127&siteid=1&sb=0&d=1&at=7&ft=11 &tf=0&pageid=1
Private Sub savePDFtoTIF(ByVal fullPathPDF As String, ByVal
fullPathTIF As String)
Dim PDFApp As Acrobat.AcroApp
Dim PDDoc As Acrobat.CAcroPDDoc
Dim AVDoc As Acrobat.CAcroAVDoc
Dim JSObj As Object
' Create Acrobat Application object
PDFApp = CreateObject("AcroExch.App")
' Create Acrobat Document object
PDDoc = CreateObject("AcroExch.PDDoc")
' Open PDF file
PDDoc.Open(fullPathPDF)
' Create AV doc from PDDoc object
AVDoc = PDDoc.OpenAVDoc("TempPDF")
' Hide Acrobat application so everything is done in silent
mode
PDFApp.Hide()
' Create Javascript bridge object
JSObj = PDDoc.GetJSObject()
' Attempt to save PDF to TIF image file.
' SaveAs method syntax .SaveAs( strFilePath, cConvID )
' For TIFF output the correct cConvid is
' cCovid MUST BE ALL LOWERCASE.
JSObj.SaveAs(fullPathTIF, "com.adobe.acrobat.tiff")
PDDoc.Close()
PDFApp.CloseAllDocs()
' Clean up
System.Runtime.InteropServices.Marshal.ReleaseComObject(JSObj)
JSObj = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(PDFApp)
PDFApp = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(PDDoc)
PDDoc = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(AVDoc)
AVDoc = Nothing
End Sub

Hi I tried with the lowercase 's' in saveAs(),
I am still getting the same error
'UnsupportedValueError: Value is unsupported. ===> Parameter cConvID.'
Wierd thing is I am not getting the 'saveAs()' method as an option for the JSObj at all I am just forcibily typing it. May be, do you guys think I am missing any reference. I have a project reference for the Acrobat 9 com component (Component Name: Acrobat Typelib version 1.0, C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.tlb
Please help.
My exact code is:
Dim JSObj As Object, strPDFText As String
' Create Acrobat Application object
PDFApp = CreateObject("AcroExch.App")
' Create Acrobat Document object
PDDoc = CreateObject("AcroExch.PDDoc")
' Open PDF file
PDDoc.Open("D:\Applications\Test_winapp\PDFUtility\WindowsApplication1\WindowsApplication 1\sample.pdf") ' Path of some PDF you want to open
' Hide Acrobat application so everything is done in silent mode
PDFApp.Hide()
' Create Javascript bridge object
JSObj = PDDoc.GetJSObject()
' Create Tiff file
JSObj.saveAs("D:/Applications/sample.tiff", "com.adobe.Acrobat.tiff")
PDDoc.Close()
PDFApp.CloseAllDocs()
' Clean up
System.Runtime.InteropServices.Marshal.ReleaseComObject(JSObj)
JSObj = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(PDFApp)
PDFApp = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(PDDoc)
PDDoc = Nothing

Similar Messages

  • PDF to TELEFAX using BCS

    We have a requirement to send an Adobe PDF form to a FAX. I talked to an Adobe guy and told me that was possible, there is no need to reconvert in OTF, before posting this I search on SDN and found nothing.
    First I am using the ABAP CL_BCS (Business Communication Services) class to send PDF has a fax, this is the same as for email, so far so good, it works for email but not for FAX, I am missing a piece in the puzzle but I think I am very close, my FAX is generated and visible in transaction SOST, but the light is red.
    The only difference between FAX and EMAIL using BCS is when you create the recipient, it should looks something like this for FAX
    recipient = cl_cam_address_bcs=>create_fax_address(
                  i_country = <lf_recipient>-c_country
                  i_number  = <lf_recipient>-c_fax_number ).
    Interrogation
    In transaction SCOT, we have 2 nodes under TELEFAX, both active. When I saw my FAX in SOST, it's red, I can see by which node id it was assigned, how the system determine that ?
    Wen you click on a telefax node, click on the set button where the checkbox for fax is, your are in the restriction dialog window, this is where you set the country and output type PDF, RAW, PCL, for example the first drow down is for SAPscript / Smartforms, we currently have PCL, it should be PDF ? But if I change the sapscript and smartforms maybe won't work ?
    thanks for help
    Alex
    If we already have a node in transaction SCOT under TELEFAX, but this node is setup has PCL for SAPscript/Smartforms in the restriction, should we change it for PDF in the dropdown list, my guest is yes! But if we do, the smartforms & sapscript output will not fax correctly cause they are PCL, how can we have 2 nodes for PCL / PDF
    you help is very welcome,
    regards,
    Alexandre Giguere

    Hi I tried with the lowercase 's' in saveAs(),
    I am still getting the same error
    'UnsupportedValueError: Value is unsupported. ===> Parameter cConvID.'
    Wierd thing is I am not getting the 'saveAs()' method as an option for the JSObj at all I am just forcibily typing it. May be, do you guys think I am missing any reference. I have a project reference for the Acrobat 9 com component (Component Name: Acrobat Typelib version 1.0, C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Acrobat.tlb
    Please help.
    My exact code is:
    Dim JSObj As Object, strPDFText As String
    ' Create Acrobat Application object
    PDFApp = CreateObject("AcroExch.App")
    ' Create Acrobat Document object
    PDDoc = CreateObject("AcroExch.PDDoc")
    ' Open PDF file
    PDDoc.Open("D:\Applications\Test_winapp\PDFUtility\WindowsApplication1\WindowsApplication 1\sample.pdf") ' Path of some PDF you want to open
    ' Hide Acrobat application so everything is done in silent mode
    PDFApp.Hide()
    ' Create Javascript bridge object
    JSObj = PDDoc.GetJSObject()
    ' Create Tiff file
    JSObj.saveAs("D:/Applications/sample.tiff", "com.adobe.Acrobat.tiff")
    PDDoc.Close()
    PDFApp.CloseAllDocs()
    ' Clean up
    System.Runtime.InteropServices.Marshal.ReleaseComObject(JSObj)
    JSObj = Nothing
    System.Runtime.InteropServices.Marshal.ReleaseComObject(PDFApp)
    PDFApp = Nothing
    System.Runtime.InteropServices.Marshal.ReleaseComObject(PDDoc)
    PDDoc = Nothing

  • SIPS: convert PDF to TIFF

    I'm not sure whether this is the correct location for posting this, but anyway:
    I want to convert a PDF to TIFF, using SIPS.
    Unfortunately, and I think I understand why, SIPS cannot detect the resolution of a PDF, and defaults to 150 dpi.
    So, when I want to convert a PDF of which I know that the images are 300 dpi, to a 300 dpi TIFF, SIPS interpretes the PDF and than scales it up to 300, effectively just doubling pixels and blurring the image.
    Is there a way of telling SIPS that my PDF is of a high enough resolution?
    I hope someone can help me here.
    Regards
    Manfred

    Post your sips query to the Unix forum under OS X Technologies. As for the PDF->TIFF, see http://discussions.apple.com/thread.jspa?threadID=2490312

  • PDF to TIFF error: Image is too wide to output Acrobat X Pro

    I have been using Adobe Acrobat X Pro to convert PDFs to TIFFs.    All of the sudden this week I am getting an error saying the Image is too wide to convert.  These are files I previously converted without a problem.  I am specifying resolution of 360 pixels in the TIFF settings (which is what I have always used).  I installed the latest maintenance (10.1.12) but still get the error.  The files are 17" wide x 11" high. Any idea why I am getting this error all of the sudden and how to fix it?  I send the files to a colleague on the same Acrobat Pro X release and they do not get the errors.  Reboot resolves for 1 file, then the error comes back.

    The issue should be the resolution.  I've had this same issue before so I'll give you a walk through of what I did.  You will need to reprint your current PDF to a new PDF with a new resolution.  Upon doing that, the new PDF will need to match whatever resolution is being required by whoever is needing this TIFF File, if there is not a requirement just pick one (such as 300 DPI).
    1) In your existing document select Print (Ctrl+P)
    2) Change your current printer to "Print to PDF/Adobe PDF/ ETC..." (whatever it is called)
    3) Select Properties and a dialog box called "Adobe PDF Document Properities" should pop up.
    4) Select the tab labeled Paper/Quality
    5) Select "Advanced..."
    6) There is an option for graphic that should have a print quality labeled " XXXX DPI" (could be anywhere from 72, 300, 600, 1200, 2400, 3600, 4800), select what you want to use, click OK back out to the basic print screen, and print your new PDF and label it whatever you want your TIFF's to be called. (I use 300 as that is what a city I submit to requires for plans).
    7) Open your new PDF, and on your menu bar at the top select EDIT (right next to file) then select "Preferences" at the bottom on the drop-down menu. (or on your keyboard use "Ctrl+K" for a faster way to get to preferences)
    8) From there select Convert from PDF then select TIFF from the list of options from the box in the middle> then select "Edit Settings..." under the box on the far right that has the information about how it saves TIFF Files currently.
    9) There should be a "Save As TIFF Settings" Dialog box that opens up and at the bottom there is a place under "Conversion" that says resolution.
    10) Change the resolution to whatever your new PDF was saved and and that should fix your problem!
    I know some of this was basic stuff but I see this question come up in different places and no one has really mapped it out like above. Hope this helps!

  • Getting 'Out of memory' error while opening the file. I have tried several versions of Adobe 7.0,9.0,X1. It is creating issue to convert PDF into TIFF. Please provide the solution ASAP

    Hello All,
    I am getting 'Out of memory' error while opening the file. I have tried several versions of Adobe 7.0,9.0,X1.
    Also, it is creating issue to convert PDF into TIFF. Please provide the solution ASAP.

    I am using Adobe reader XI. When i open PDF it gives "OUT of memory" error after scrolling PDF gives another alert "Insufficient data for an image". after clicking both alerts it loads full data of PDF. It is not happening with all PDFs. couple of PDFs are facing this issue. Because of this error my software is not able to print these PDFS into TIFF. My OS in window7*64. I tried it on win2012R2 and XP. Same issue is generating there.
    It has become critical issue for my production.

  • I am using Adobe Acrobat 9 Standard version in Windows 8.1 and when I try to create a .pdf file, I receive the following error message "Acrobat could not open "file name.log" because it is either not a supported file type or because the file has been dama

    I am using Adobe Acrobat 9 Standard version in Windows 8.1 and when I try to create a .pdf file, I receive the following error message "Acrobat could not open "file name.log" because it is either not a supported file type or because the file has been damaged.  To create a PDF document, go to the source application then print the document to .pdf"  I am going to the source application and printing the document to .pdf yet it's saving the file as a .log file.  After reinstalling the software, I initially didn't encounter this problem but on my second and third attempts to convert files to .pdf format, this error message reappeared.  How do I resolve this problem?

    I have a similar problem which i did not have before...and it exists only in some powerpoint files which i want to print as a pdf file...and i get the same message as above.
    the log says the bellow details...what's the problem and how can i resolve it? thanks.
    %%[ ProductName: Distiller ]%%
    %%[Page: 1]%%
    %%[Page: 2]%%
    Cambria not found, using Courier.
    %%[ Error: invalidfont; OffendingCommand: show ]%%
    Stack:
      %%[ Flushing: rest of job (to end-of-file) will be ignored ]%%

  • I have Acrobat 9.5 and when I try to create pdf from scanner, it displays an error "Adobe acrobat has stopped working". Is there any way I can use this functionality?

    I have Acrobat 9.5 and when I try to create>pdf from scanner, it displays an error "Adobe acrobat has stopped working". Is there any way I can use this functionality?

    Provide you have Acrobat 9 installed in an OS for which Acrobat 9 is compatible then you can use the functionality.
    As well, you need a scanner connected, powered up, and the software installed. Acrobat 9 "prefers" TWAIN drivers.
    Always visit the scanner vendor's site and download - install the latest greatest software.
    n.b., The Acrobat 9.x product family passed into "End of Support" mid-year 2013.
    As well the Acrobat 9.x product family is not compatible with contemporary OSs.
    Be well...

  • When I try to forward a PDF file by using the email button on the toolbar, it won't send.

    I cannot always forward a PDF using the email button on the toolbar.  For example, I get a report forwarded to me as a link.  When I open the link, the document opens as a PDF.  I use the email button on the toolbar to forward the document as an attachment.  Outlook pops up as a new message with the attachment.  I finish writing my email and hit the "send" button and I get an error saying the doucment couldn't be sent.  If I close the email and save it as a draft, I can open the draft copy and it will send.  Is there someway to fix this so I can eliminate these extra steps?  This has happened on a computer with Adobe Reader as well as a computer with Adobe Acrobate 9 Standard. 

    teresah7680 wrote:
    the doucment couldn't be sent.
    Is that the exact message that Outlooks gives you?
    Anyway, why don't you just forward the original link to the document, instead of the PDF itself?

  • Not able to Open PDF in Email using CL_BCS

    Hello Experts,
    I am using CL_BCS to send an email that contains PDF as attachment.
    The PDF doucment should contain below text.
    "This is test system".
    Thanks.
    I am able to send an email that contains PDF as attachment. But while opening PDF document, I am getting internal error.
    Can you please suggest me any workaround for the same? It would be great if you can provide me sample code for the same.
    Regards,
    Amit

    hello,
    i am failure to open PDF in my new phone, do you know why? here is my phone data: www.eshopbing.com/ciphone-c6-16gb-30-smart-phone-with-windows-61-gps-wifi-p-600. html
    it's Windows 6.1, is it the same with Windows Mobile Emulator 6.5? please tell me if you know. Thank you very much.

  • SSRS PDF Export. There was an error opening this document. This file is damaged and could not be repaired

    Hello,
    I just experienced this problem, and was able to successfully mitigate.  I wanted to share my experience and Solution. 
    The problem started with the following error after succesfully exporting a PDF Document.  "There was an error opening this document. This file is damaged and could not be repaired."
    This is only applicable if you can still export and open SSRS Reports to other formats. Go to the Log files of the SQL Instance. In my particular case I used the Default MSSQL instance:   C:\ Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting
    Services\LogFiles  
    The Folder will begin with MSRS (SRS is for SQL Reporting Services)
    Sort the files by date modified and check for the most recent log file: ex.  SQLDmpr0000.log  The 0000 will be the incremental amount of errors you have experienced in SRS. Check for the following error:
    "System.DllNotFoundException: Unable to load DLL 'T2Embed': Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
    Below is a sample from the log. 
    reportrendering!ReportServer_0-1!1b78!02/07/2012-11:56:03:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: , Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException:
    An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.DllNotFoundException: Unable to load DLL 'T2Embed': Access
    is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
       at Microsoft.ReportingServices.Rendering.ImageRenderer.FontPackage.TTGetEmbeddingType(Win32DCSafeHandle hdc, UInt32& status)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.FontPackage.CheckEmbeddingRights(Win32DCSafeHandle hdc)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.ProcessFontForFontEmbedding(PDFFont pdfFont, Dictionary`2 embeddedFonts)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFWriter.EndReport()
       at Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer.Render(Report report, NameValueCollection deviceInfo, Hashtable renderProperties, CreateAndRegisterStream
    createAndRegisterStream)
       at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo,
    NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
       --- End of inner exception stack trace ---
       at Microsoft.ReportingServices.Rendering.ImageRenderer.RendererBase.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo,
    NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
       at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderFromOdpSnapshot(IRenderingExtension newRenderer, String streamName, ProcessingContext
    pc, RenderingContext rc)
       --- End of inner exception stack trace ---;
    If you notice the error states that T2Embed.dll access is denied. In my case this due to a hotfix installed by Microsoft: 
     MS11-087: Vulnerability in Windows kernel-mode drivers could allow remote code execution: December 13, 2011
    Be advised, in order to fix your problem and render pdf's, a vulnerability shall be created.
     To fix this issue and allow the export to PDF work correctly, you must give the system Read/Execute Permissions, and Built-in\Administrators Full Control. 
    Go to Windows\System32 and find the T2Embed.dll Go to Security and modify the permissions as listed above. Do the same to the T2Embed.dll in the SysWow64 folder.
    Restart Reporting Services and you will be able to export to PDF. 
    Best Wishes! 
    Mariano
    www.lucontech.com 

    I'm not convinced this is the exact cause of the issue.  I will check my log files to see if I find anything like what you described.  However, I get this error when a particular user tries to do a "print preview" from a custom button.  The
    code builds a ReportViewer object, sets the ReportPath, etc.
    The reason I'm not convinced is because we have a separate reports page that has the report viewer embedded into it.  If the user generates the report that way and exports to PDF, Word, etc...the user can generate the file and be on their way.  As
    soon as the user clicks our "Print" button on the page without the ReportViewer embedded, the above mentioned error occurs.  
    UPDATE: Perhaps we have a different problem since my issue is from a custom button.  I found the solution
    here and confirmed the solution with the customer.  It had to do with the code using Response.Flush() instead of Response.End().
    One thing I noticed before I implemented the change: When you would close the PDF, it would ask you to save changes to the PDF.  After implementing Response.End() instead, that prompt went away.  No doubt it has to do with the differences between
    how Response.Flush() and Response.End() handle the stream returned.
    Anyway, posting in case someone has the same issue.

  • Create a PDF from webpage using entire site option doesn't works

    OK, guys, this is the problem...
    After YEARS of testing from Acrpbat 4 thru 9 on Create a PDF from webpage using entire site option... it doesn't works properly and doesn't got the entire site. ALWAYS get an error of memory or any other error but FINALLY you NEVER got the entire site. I'm talking for a big website... not like amazon.com, but a big one.
    I make a walkarround to try to capture the website in parts but Acrobat is not "intelligent" to make a resume capture of the site, because ALWAYS start from the begining instead from the resume position of the site...
    My question is, HOW can get the ENTIRE SITE in a PDF document... without getting errors or stopping the capture process...
    Don't have problem of low RAM memory because I'm in a MONSTER MACINTOSH.... 3.2 GHZ with 8 Core and 32 GB of RAM under Mac OS X Leopard 10.5.6 in Acrobat 9 Pro.
    If I'm not wrong, the GET ENTIRE SITE option in Web Capture (Create a PDF from webpage using entire site option) doesn't works from Acrobat 4 thru 9 in Pro version... tested, you'll never got the entire site... I'm talking in capture a huge entire site and not a little one...
    Can someone help me?
    Thanks.

    Ok so I go to a web page and select something to print. Once I've clicked print I switch over from printer/micosoft xps docu writer/fax and select Adobe PDF. All goes through with a 'Create Adobe PDF' coming up progressing through to eventually save and store. Once I open the file it end up as the picture above. I have the same version on another computer and that works fine but this particular Sony laptop it doesn't seem to work properly. 

  • Adobe reader (11.3.2) PDF's on ipad and getting error that the file is corrupt!!

    i have the latest Adobe reader from the app store (11.3.2) however i am struggling to open PDF's on ipad and getting error that the file is corrupt!!
    any help or suggestions welcome

    Would you describe how you transferred the PDF file to your iPad and iPhone?  Did you send it as an email attachment and open it on your iPad and iPhone?
    The file may have been corrupted by Apple Mail, which is a known problem.  Please see Problem #1 in the FAQ document How to avoid known PDF email attachment problems.
    Would you try some experiments so that we can troubleshoot the problem?  During the experiments, please use cloud storage (e.g. Acrobat.com, Dropbox, Google Drive, etc.) and avoid sending the PDF file as an email attachment.
    Rename the corrupted/damaged PDF file on your iPad.  For example, add "_damaged.pdf" to the file name.
    Upload the corrupted/damaged PDF file to the cloud storage of your choice.
    Download the corrupted/damaged PDF file from the cloud storage to your Windows or Mac desktop computer.
    Open it in the desktop version of Adobe Reader XI for Windows or Mac.
    Does Adobe Reader XI on your desktop computer display an error message?
    Upload the (good) PDF file on your iPhone to the cloud storage.
    Download the (good) PDF file from the cloud storage to your iPad.
    Open it in Adobe Reader on your iPad.
    Does Adobe Reader on your iPad display an error message?
    We can investigate further based on what you will find.
    Thank you for your help.

  • Writing XMP to multiple file formats (PDF, JPEG,  TIFF, etc)

    Hi,
    I am developing a server-side component that embeds XMP data into a file (of various formats) and then provides these files for client download.
    I have been using the XMP toolkit for generating the metadata, however i now have the problem of getting this metadata into the relevant file. I could always develop this myself but it seems like a huge amount of work. So to make my life easier, does anyone know of any toolkits (from adobe or otherwise) that support writing XMP data into different file formats (PDF, JPEG, TIFF, AIFF, MPEG etc) ??
    I am developing in Java so I would prefer Java libraries, however I can always use JNI calls to C/C++ (as i have with the XMP toolkit).
    Any help would be very appreciated.
    Regards,
    Jude

    Greetings,
    I think we should standardize some information, I know for a fack, that I will support adding XMP metadata in the HDF, RIFF, IFF and OLE file formats. If you have any specific suggestions on the chunk information or signature information that I should use, let me know?
    For my part, I was thinking of adding RIFF,IFF chunks with the name \ xmp in those file formats. For OLE, maybe an added stream with the xmp name (in UTF-16).
    Comments welcome everyone!

  • When I try to open a pdf  I get a acrobat reader error, It states ( There was an error opening this

    When I try to open a pdf  I get a acrobat reader error, It states ( There was an error opening this document. Could not repair file.

    There is not modern program called Acrobat Reader. There is an Adobe Reader program, there is an Adobe Acrobat (Pro or Std) program. Which program are you using? Under which OS?
    Please repost your question with your answer to either the Adobe Reader forum: http://forums.adobe.com/community/adobe_reader_forums  or  or the Acrobat Installation forum: http://forums.adobe.com/community/acrobat/installation_and_update_installation

  • Applescript to convert PDF to JPEG using Preview?

    I know there's an existing script available on the internet that converts PDFs to JPEGs (it's here: http://macscripter.net/viewtopic.php?id=25350) BUT, for whatever reason, the quality, even when set to 600dpi, is crap. I get better results simply opening the PDF in Preview then saving as JPEG... even a 150dpi JPG from Preview is higher quality than a 600dpi file from this script I found...
    So, what I need help with is creating a applescript that converts PDF's to JPEGs using Preview (or whatever, as long as the quality of the JPEG is good). I have very little scripting experience so help is appreciate.
    Ideas?
    Thanks.

    Frank Caggiano wrote:
    Decided to finish this up as an interesting exercise. Hope you find it useful.
    One question for the  Applescripters here. The Automator action run as a shell script seems to return a list of filename aliases but the return value while looking like a list didn't behave as a list. I managed to rip it apart to get to the filepaths and the script works but it seems really kludgey . So my question is given the return of the Automator run as a do shell script what is a more correct way to handle it?
    Convert PDF to JPG
              © 2011 Frank Caggiano
              GNU Public License
              Convert pfd files to jpg images.
              The converted JPG files wil have the name of the original PDF files with the extension changed to JPG.
              The actual conversion uses the Automator action Render PDF Pages as Images.
              The user needs to create an Automator action with Render Pages as Images as the single action.
              Set the parameters for the conversion in the action.
              NOTE: this script assumes you're converting to jpg files If you select another output format in the action this script will
              need to be modified.
    -- choose PDF files
    try
              set sourceFiles to choose file with prompt "Select PDF files" of type {"com.adobe.pdf"} with multiple selections allowed
    on error msg number n
              if n ≠ -128 then
                        error "Unknow error: " & msg & space & n
              else
      quit
              end if
    end try
    -- choose destination folder
    try
              set destFolder to choose folder with prompt "Select Destination Folder"
    on error msg number n
              if n ≠ -128 then
                        error "Unknow error: " & msg & space & n
              else
      quit
              end if
    end try
    set destFolder to quoted form of POSIX path of destFolder
    -- select workflow
    try
              set workFlow to choose file with prompt "Select Work Flow" of type {"com.apple.automator-workflow"}
    on error msg number n
              if n ≠ -128 then
                        error "Unknow error: " & msg & space & n
              else
      quit
              end if
    end try
    set workFlow to POSIX path of workFlow
    repeat with sourceFile in sourceFiles
      -- get base name of the source file
              set bName to do shell script "basename " & quoted form of POSIX path of sourceFile
      -- Strip off the extension
              set text item delimiters to "."
              set bName to text item 1 of bName
              try
                        set res to do shell script "automator -i " & quoted form of POSIX path of sourceFile & space & workFlow
              on error msg number n
                        error msg & space & n
              end try
      -- Seems strange to  do it this way but it works
              set text item delimiters to "\""
              set theList to text items of res
    We go through the list of converted files. If there is more then one then the second and subsequent files
    will get and integer added to the name to avoid conflict.
              set cnt to 0
              repeat with convertedFile in theList
                        if convertedFile does not contain "alias" and convertedFile does not contain "}" then
                                  set fullPath to quoted form of POSIX path of convertedFile
                                  if cnt ≠ 0 then
                                            do shell script "mv " & fullPath & space & destFolder & bName & "_" & cnt & ".JPG"
                                  else
                                            do shell script "mv " & fullPath & space & destFolder & bName & ".JPG"
                                  end if
                                  set cnt to cnt + 1
                        end if
              end repeat
    end repeat
    Hi Frank--
    I tried the script you wrote and created the Automator workflow with the single action as requested, saved it to the desktop then selected it when your script's dialogue requested it. However, at that point your script game me the following error. Ideas? I did save the workflow as a workflow and I selected it directly, so I'm not sure why it thinks that the "workflow file does not exist" ? :
    error "The workflow file does not exist. 255" number -2700 from «script» to item

Maybe you are looking for