Skip navigation
Josh Genti
Currently Being Moderated

In-design Server CS4 Export to RTF format with Images not working via Java API

Mar 28, 2012 8:57 AM

Tags: #cs4 #indesign_server #indeisgn_server

I'm using Adobe In-Design Server CS4.  And I'm accessing it via the Java SDK API interface.

 

While attempting to export my story to Rich Text Format (RTF), the images are getting left out. 

 

Yet, taking the exact same .idml file, opening it inside the desktop In-Design App, clicking inside the story, selecting "Export" & choosing "RTF", gives me a .rtf file that includes the images. 

 

Am I missing some setting somewhere in the SDK that I have to expliciately state I want images?  Or do I need to do my export off something other than the Story object? 

 

I know the images are valid, as not only does the export to RTF via the desktop application work, but through the SDK API, I can Export to PDF & the pdf includes the images.  So the image files are valid.  

 

 

Here's a code snippet.  Note the "closeDocument" method simply invokes the typical doc.close method with some custom exception handling.

 

 

                 int mainStoryIndex = 0;

                 boolean isRTF = true;  //flag to control export of rtf or pdf file.

         String documentPath = localTempDir + File.separatorChar + "NewDocument.idml";

         String pdfPath= localTempDir + File.separatorChar + "NewDocument.pdf";

         String rtfPath= localTempDir + File.separatorChar + "NewDocument.rtf";

         VariableType vtDocument = myApp.open( VariableTypeUtils.createFile( documentPath ) );

         com.adobe.ids.basics.Document doc= DocumentHelper.narrow(vtDocument.asObject());

                    

                if(isRTF) {

                          Story exportStory = doc.getAllChildStorys()[mainStoryIndex];

                          exportStory.doExport(VariableTypeUtils.createEnumeration( com.adobe.ids.enums.kExportFormatRTF.value ), rtfPath, optPreset, OptArg.noString(), OptArg.noBoolean());

                          closeDocument(doc, documentPath );

                } else {

                          doc.doExport( VariableTypeUtils.createString("Adobe PDF"), pdfPath, optPreset, OptArg.noBoolean(), OptArg.noString(), OptArg.noBoolean());

                          closeDocument(doc, documentPath);

                }

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points