Skip to main content
Known Participant
February 2, 2023
Question

Unable to export as JPG from Indesign server

  • February 2, 2023
  • 1 reply
  • 237 views

Hi Experts,

 

Running InDesign Server, trying to export a page as JPG.

 

Here is my code 

var myFolder = Folder("C:/server/sample_document");

var myIndsnFiles = myFolder.getFiles("*.idml");

for(k=0; k<myIndsnFiles.length; k++)

{
doc= app.open(myIndsnFiles);

var doc = app.documents[0];
app.jpegExportPreferences.pageString='1';

//export that page from the document:
var myFile = new File('C:/test.jpg');
doc.exportFile(ExportFormat.JPG, myFile);
}

 

Could you please help me to understand the issue.

 

Thank you

This topic has been closed for replies.

1 reply

hm_arulAuthor
Known Participant
February 2, 2023

Able to resolve with small file path fix. Sorry.

var myFolder = Folder("C:/server/sample_document");

var myIndsnFiles = myFolder.getFiles("*.idml");


for(k=0; k<myIndsnFiles.length; k++)

{
doc= app.open(myIndsnFiles);

var doc = app.documents[0];

app.jpegExportPreferences.pageString='1';

//export that page from the document:
var myFile = File('/C/01/test.jpg');
doc.exportFile(ExportFormat.JPG, myFile);
}

Loic.Aigon
Legend
February 2, 2023

Thanks for letting people know. May I invite you to outline more precisely the fix that you did and why it solved your issue? That way, future readers may find them more quickly the answer in case of a similar problem.