I’m using Aspose.PDF to create a PDF from a directory of JPG files. When the total size of the JPG files is up to 200 MB or so, the file is create properly. However, if I add in 250MB of JPG files, the Aspose.Pdf.Generator.Pdf.Save() routine saves a file with zero bytes.
Hi there,
We are sorry for the inconvenience caused. While testing the scenario with the latest version of Aspose.Pdf for .NET 9.3.0, we have managed to reproduce the reported issue and logged it in our bug tracking system as PDFNEWNET-37074 for further investigation and resolution. We will notify you via this thread as soon as it is resolved.
Please feel free to contact us for any further assistance.
Best Regards,
Hi there,
string curdir = “E:/Data/Images”;<o:p></o:p>
Document doc122 = new Document();
string[] files = Directory.GetFiles(curdir, ".");
if (files.Length == 0)
{ Console.WriteLine("No files found!");
return;
}
for (int ifile = 0; ifile < files.Length; ifile++)
{
Console.WriteLine("Adding image " + ifile + " out of " + files.Length);
Page page = doc122.Pages.Add();
// Bitmap b = new Bitmap(mystream);
// Set margins so image will fit, etc.
page.PageInfo.Margin.Bottom = 0;
page.PageInfo.Margin.Top = 0;
page.PageInfo.Margin.Left = 0;
page.PageInfo.Margin.Right = 0;
//page.PageInfo.Height = (b.Width / b.HorizontalResolution) * 72;
//page.PageInfo.Width = (b.Height / b.VerticalResolution) * 72;
//page.PageInfo.Height = Aspose.Pdf.PageSize.A4.Height;
//page.PageInfo.Width = Aspose.Pdf.PageSize.A4.Width;
//Create an image object
Aspose.Pdf.Image image = new Aspose.Pdf.Image();
//Add the image into paragraphs collection of the section
page.Paragraphs.Add(image);
//Set the ImageStream to a MemoryStream object
image.File = files[ifile];
}
//Save the Pdf
doc122.Save(curdir + "newfileDOM.pdf");
Console.WriteLine("Done!");
Please feel free to contact us for any further assistance.
Best Regards,
The issues you have found earlier (filed as PDFNEWNET-37074) have been fixed in Aspose.Pdf for .NET 9.6.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.