adobe/PDFServices.NET.SDK.Samples

PDF to DOCX conversion is not working for certain pdf files

Closed this issue · 2 comments

Hi,

We are trying to convert a PDF stream to document stream using the adobe tools API.
Below is the sample code:

public MemoryStream ConvertPDFStreamToDocStream(Stream pdfMemoryStream)
{
              ExportPDFOperation exportPdfOperation = ExportPDFOperation.CreateNew(ExportPDFTargetFormat.DOCX);

                // Set operation input from a local PDF file
                FileRef sourceFileRef = FileRef.CreateFromStream(pdfMemoryStream, "application/pdf");
                exportPdfOperation.SetInput(sourceFileRef);

                // Execute the operation.
                FileRef result = exportPdfOperation.Execute(executionContext);

                MemoryStream outputStream = new MemoryStream();
                result.SaveAs(outputStream);

                return outputStream;

}

For certain PDF documents, it throws below error:
image

Could you kindly help here in debugging the issue?

@PriyankaRanganath : Would it be possible for you to share the document with us for further debugging?

Closing this issue since it has been idle from long. Please feel free to re-open it in case of further queries.