6 Replies Latest reply on Jan 28, 2010 12:30 AM by Harbs.

    [CS4] Export to ePub/eBook

    Caerwyn Level 1

      Hi,

       

      I can export to pdf and eps via visual basic.

      It's possible from the File menu to Export to Digital Editions, how do I do the same from the scripting interface.

      ie; export to ePub/Book.

       

      Thanks for any help

       

      Caerwyn

        • 1. Re: [CS4] Export to ePub/eBook
          AdobeScripts Level 3

          hi

           

          Sub Export(Format, To As String, [ShowingOptions As Boolean = False], [Using], [VersionComments], [ForceSave As Boolean = False])
              Member of InDesign.Document
              Exports the object(s) to a file.
              Format: The export format, specified as an enumeration value or as an extension that appears in the Save as type or Format menu in the Export dialog. Type: idExportFormat enumerator or String.
              To: The path to the export file.
              ShowingOptions: If true, displays the export options dialog.
              Using: The export style. Type: PDFExportPreset.
              VersionComments: The comment for this version. Type: String.
              ForceSave: If true, forcibly saves a version.

           

          and as Format - I think this should be right:

           

          Const idPackagedXFL = 1702389356 (&H6578666C)
              Member of InDesign.idExportFormat
              Exports to packaged XFL format.

           

          For setting extra options:

           

          Class XFLExportPreference
              Member of InDesign
              XFL export preferences.

           

          robin

          www.adobescripts.co.uk

          1 person found this helpful
          • 2. Re: [CS4] Export to ePub/eBook
            Peter C Hayward Level 1

            Well so far so bad!

            I can create a file with the epub extension but it's not an epub file.

             

             

             

            import win32com.client, pythoncom

             


            def main():
                """
                Script entrypoint
                """
                myInDesign=win32com.client.Dispatch('InDesign.Application.CS4')
                myDocument = myInDesign.Documents.Add()
                myPage = myDocument.Pages.Item(1)
                myTextFrame = myPage.TextFrames.Add()
                myTextFrame.GeometricBounds = ( '6p', '6p', '24p', '24p' )
                myTextFrame.Contents = "Hello World!"

             

                idPackagedXFL = 1702389356
                myFilePath = "C:\Incoming\Test_eBook.epub"
                myDocument.Export( idPackagedXFL, myFilePath )

             

            if __name__ == '__main__':
                main()

             

             

             

            If I use the menu option to export the same created file and then compare the binaries then the real file has the text

                 mimetypeapplication/epub+zipPK

            but the file created by the python script contains

                 mimetypeapplication/vnd.adobe.xflPK

             

            I'm sure this must be possible.

            I've looked through the type lib and I can't see an epub file type.

            Yet I think it's unlike Adobe to put Export for Digital Editions in the menu and not make it scriptable.

            • 3. Re: [CS4] Export to ePub/eBook
              Caerwyn Level 1

              Sorry, I didn't realise that the PC was logged into my colleagues account!

              That last reply was actually from me.

               

              Caerwyn

              • 4. Re: [CS4] Export to ePub/eBook
                [Jongware] Most Valuable Participant
                Yet I think it's unlike Adobe to put Export for Digital Editions in the menu and not make it scriptable.

                 

                It's not mentioned anywhere in the Scripting help. Perhaps it's a similar trick as Export To Dreamweaver -- an integrated Javascript, rather than a "real" plugin. The InDesign SDK has lots of information on the Dreamweaver export, including its javascript sources, so you could take a peek in there.

                • 5. Re: [CS4] Export to ePub/eBook
                  AdobeScripts Level 3

                  Prestige Pete wrote:

                   

                  If I use the menu option to export the same created file and then compare the binaries then the real file has the text

                       mimetypeapplication/epub+zipPK

                  but the file created by the python script contains

                       mimetypeapplication/vnd.adobe.xflPK

                  I'm sorry for misunderstanding I've never used this options and it was only guess

                  XFL is for Flash export.

                  I'm sure this must be possible.

                  I've looked through the type lib and I can't see an epub file type.

                  Yet I think it's unlike Adobe to put Export for Digital Editions in the menu and not make it scriptable.

                  Now after more precise inspection of ObjectBrowser (VB6) - I don't see anything related to ePub - so this is probably done by some plugin ...

                   

                  ==========

                   

                  I think I found it there is few scripts located in:

                   

                  [install path to CS4]\Adobe InDesign CS4\Scripts\XHTML For Digital Editions\

                   

                  and in ..\Adobe InDesign CS4\Scripts\XHTML For Digital Editions\startup scripts\OEBExportMenuItemLoader.jsx

                   

                  there is:

                  // Purpose: Export InDesign documents to epub files or Digital Editions

                   

                  but all other scripts are as JSXBIN ...

                   

                  robin

                  www.adobescripts.com

                  1 person found this helpful
                  • 6. Re: [CS4] Export to ePub/eBook
                    Harbs. Level 6

                    The export for Digital Editions is itself a script, and therefore not 

                    really scriptable...

                     

                    Harbs