Skip to main content
Participant
April 2, 2023
Question

PDF to Image with stream

  • April 2, 2023
  • 0 replies
  • 255 views

I have this code:

MemoryStream ms = new MemoryStream(file);
FileRef sourceFileRef = FileRef.CreateFromStream(ms, ExportPDFOperation.SupportedSourceFormat.PDF.GetMediaType());
ExportPDFToImagesOperation exportPDFToImagesOperation = ExportPDFToImagesOperation.CreateNew(ExportPDFToImagesTargetFormat.PNG);
exportPDFToImagesOperation.SetInput(sourceFileRef);

// Execute the operation.
List<FileRef> result = exportPDFToImagesOperation.Execute(executionContext);

 

It works perfectly except it writes all these images to the temp directory.

 

I'd like to avoid that overhead.  Is there any way to do this using a MemoryStream?

This topic has been closed for replies.