Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Server Developers
Viewing all articles
Browse latest Browse all 20709

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

$
0
0

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);

                }


Viewing all articles
Browse latest Browse all 20709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>