Skip to main content
Participant
July 26, 2017
Question

PDF to HTML Conversion with Interapplication Communication Api in Mac OS

  • July 26, 2017
  • 1 reply
  • 1857 views

I'm trying to convert a PDF file via the Interapplication Communication API of Adobe Acrobat using Adobe Acrobat Pro DC 2017.009.20058 Trial Version.

My script doesn't appear to be converting my file from PDF to HTML.  It works for some formats (e.g. plain-text), but not for others (e.g. spreadsheet, xlsx).  Perhaps it is because I'm using the trial version?   Here is my AppleScript code:

set myfile to "/PATH/pdf_schedule.pdf"

set outfile to ("PATH:pdf_schedule.html" as text)

tell application "Adobe Acrobat"

  -- get every conversion

  activate

  open myfile

  save document 1 to file outfile using conversion "com.adobe.acrobat.html"

  close document 1

end tell

And `get every conversion` returns this (with html highlighted in blue):

{EPS Conversion "com.adobe.acrobat.eps" of application "Adobe Acrobat", conversion "com.adobe.acrobat.xlsx" of application"Adobe Acrobat", conversion "com.adobe.acrobat.html" of application "Adobe Acrobat", conversion "com.adobe.acrobat.jpeg" of application "Adobe Acrobat", conversion "com.adobe.acrobat.jp2k" of application "Adobe Acrobat", conversion"com.callas.preflight.pdfa" of application "Adobe Acrobat", conversion "com.callas.preflight.pdfe" of application "Adobe Acrobat", conversion "com.callas.preflight.pdfx" of application "Adobe Acrobat", conversion "com.adobe.acrobat.png" ofapplication "Adobe Acrobat", PostScript Conversion "com.adobe.acrobat.ps" of application "Adobe Acrobat", conversion"com.adobe.acrobat.pptx" of application "Adobe Acrobat", conversion "com.adobe.acrobat.rtf" of application "Adobe Acrobat", conversion "com.adobe.acrobat.accesstext" of application "Adobe Acrobat", conversion "com.adobe.acrobat.plain-text" ofapplication "Adobe Acrobat", conversion "com.adobe.acrobat.tiff" of application "Adobe Acrobat", conversion"com.adobe.acrobat.doc" of application "Adobe Acrobat", conversion "com.adobe.acrobat.docx" of application "Adobe Acrobat", conversion "com.adobe.acrobat.xml-1-00" of application "Adobe Acrobat", conversion"com.adobe.acrobat.spreadsheet" of application "Adobe Acrobat"}

This topic has been closed for replies.

1 reply

Premiopolis
Inspiring
November 9, 2019

I got mixed results on this...

I was able to get the com.adobe.acrobat.jpeg to work, no problem, but no luck so far with com.adobe.acrobat.html.

The file tested perfectly using the menu option  File > Export To > HTML Web Page, but failed using AppleScript

 

Have the coding specs changed since 2017?