Is there a way to export a page as a png with InDesign server?
The following code works for a text frame. How do I do the same for the complete page contents?
var theDocument = app.documents.add();
var thePage = theDocument.pages[0];
var theTextFrame = thePage.textFrames.add();
theTextFrame.geometricBounds = [5,5,40,40];
theTextFrame.contents = TextFrameContents.placeholderText;
theTextFrame.exportFile(ExportFormat.pngFormat, File("c:\\test.png"));
if you can export as JPG, something like this should work:
I’m not sure if setting the
jpegExportPreferences.pageStringwould still work or not with exporting as a PNG, but you might be able to test that. Hopefully this at least gets you on the right track!Note that if you want to export as a PNG, use this export format:
EDIT:
Looking at this article from the Adobe Forums, it states that InDesign can export as PNG but doesn’t include any options, so it has limitations other than specifying the format. So, if the above code example won’t help, maybe try something like this:
Hope this helps!