Thanks for testing out. By looking at your code, it seems like you have assigned a file path to PDF Image and iterate in a loop.
Hi Dinesh,
Hi Dinesh,
Thanks for sharing the details.
I have again tested the scenario where I have created 55 copies of (img20140822_18405542.tif) file and when using following code snippet in Visual Studio 2012 application with target platform as .NET Framework as 4.0 running over Windows 7(x64) where I have used 3.4 Ghz processor with 8 GB RAM and I am still unable to notice any issue. The PDF document is properly being generated.
[VB.NET]
Dim pdfDocument1 As Document = New Document()
For Each FilePath As String In FileNames
Dim pdfPage As Aspose.Pdf.Page = pdfDocument1.Pages.Add()
'Set margins so image will fit, etc.
pdfPage.PageInfo.Margin.Top = 0
pdfPage.PageInfo.Margin.Bottom = 0
pdfPage.PageInfo.Margin.Left = 0
pdfPage.PageInfo.Margin.Right = 0
Dim pdfImage As New Aspose.Pdf.Image()
Dim counter As Integer
For counter = 0 To 54
Console.WriteLine("--------" & counter)
pdfImage.File = fileEntries(counter)
'Add the image into paragraphs collection of the section
pdfPage.Paragraphs.Add(pdfImage)
Next
pdfDocument1.Save("c:/pdftest/55_TIFF_Image_test.pdf")
Hi,
Hi Dinesh,
Thanks for sharing the details.
I have tested the scenario using Aspose.Pdf for .NET 10.4.0 using the following code snippet and I am unable to notice any issue. As per my observations, the 55 copies of TIFF image are converted to a single PDF file in 83 seconds.
[VB.NET]
Dim pdfDocument As Document = New Document()
Dim pdfPage As Aspose.Pdf.Page = pdfDocument.Pages.Add()
Dim pdfImage As New Aspose.Pdf.Image()
'Set margins so image will fit, etc.
pdfPage.PageInfo.Margin.Top = 0
pdfPage.PageInfo.Margin.Bottom = 0
pdfPage.PageInfo.Margin.Left = 0
pdfPage.PageInfo.Margin.Right = 0
' Retrieve names of all the Pdf files in a particular Directory
Dim FileNames() As String = Directory.GetFiles("C:\pdftest\Copies\", "*.tif")
For Each FilePath As String In FileNames
pdfImage.File = FilePath
'Add the image into paragraphs collection
'of the section
pdfPage.Paragraphs.Add(pdfImage)
Next
pdfDocument.Save("C:\pdftest\ConvertedResultant.pdf")
Hi Dinesh,
Thanks for sharing the sample application. I have tested the application and it works fine. However, the same code not works on my sample application. I will compare the project settings with your project to better understand what causing the issue. So that’s on my plate.
- Using DOM approach - Result PDF size goes to approx 75 MB (for 55 Page which equals to 55 MB)
- Using Generator appraoch - Result PDF size goes to approx 8 MB.(for 55 Page which equals to 55 MB)
Hi Dinesh,
Thanks for sharing the details.
I have tested the scenario and have observed that when placing 55 copies of TIFF image to PDF file, the resultant file of 74 MB is being generated. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-38809. We will investigate this issue in details and will keep you updated on the status of a correction.
We apologize for your inconvenience.
The issues you have found earlier (filed as PDFNET-37460) have been fixed in Aspose.PDF for .NET 19.12.
The issues you have found earlier (filed as PDFNET-37459) have been fixed in Aspose.PDF for .NET 22.5.