We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PdfFileEditor.Extract Produces empty file in v6.1 for some pdf files

Hi,

We upgraded Aspose.pdf.dll from v6.0.0 to v6.1.0. The following extract no longer works on the attached pdf:

Aspose.Pdf.Facades.PdfFileEditor pdfEditor = new Aspose.Pdf.Facades.PdfFileEditor();

List<Stream> inStreams = new List<Stream>();

int[] pages = { 1 };

string fileName = Path.Combine(System.Windows.Forms.Application.StartupPath, "Input.pdf");

Stream ms = new MemoryStream();

pdfEditor.Extract(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), pages, ms);

ms.Position = 0;

inStreams.Add(ms);

string outputFileName = Path.Combine(System.Windows.Forms.Application.StartupPath, "Extract.pdf");

FileStream outputStream = new FileStream(outputFileName, FileMode.Append);

pdfEditor.Concatenate(inStreams.ToArray(), outputStream);

outputStream.Close();

outputStream.Dispose();

foreach (Stream stream in inStreams)

{

if (stream != null)

{

stream.Close();

stream.Dispose();

}

}

Hi Samantha,

Thanks for using our products.
<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as <span style=“font-family:“Arial”,“sans-serif””>PDFNEWNET-30233. We
will investigate this issue in details and will keep you updated on the status
of a correction.<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””><span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>

We
apologize for your inconvenience.