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

Free Support Forum - aspose.com

PDF Split Sample Source code based on the PDF file Size

Hi Asad Ali,

As per your suggestion I have downloaded the v 17.6 DLL and I complied with debug Mode and it is not giving Out of memory issue. But still when I enable the compress PDF Mode. It is taking lot of time to process one item. for 50Pages of Images it is taking more than 10min. Please can you ask your development team to fix this performance issue as soon. Our customer is asking the ETA for this. And we are getting very much bad impression on us with Customer. Please I request you to ask the development to make the necessary changes and fix this performance issue as soon. Also I am not getting the reply button from this URL

Please help me out in this as soon.

For Your Reference I am providing my Actual application code here.

Right now I have made the compression mode as configurable. Please go through this code let me know if there is any changes in the code.

private void CreatePDF(ref R2Item r2Item) 
{ 
this.ClientStatusMessage = string.Format("Retrieving Images ...", r2Item.ItemName); 
Document doc = new Document(); 
int pdfCount = 1; 
int nPageCount = 0; 
int nOptimizePageCount = 0; 
ListPageCount = new Dictionary(); 
tempLocalPDFPath = Path.GetTempPath() + r2Item.ItemName; 
if (Directory.Exists(tempLocalPDFPath)) 
Directory.Delete(tempLocalPDFPath, true); 
Directory.CreateDirectory(tempLocalPDFPath); 
nOptimizePageCount = Convert.ToInt32(ConfigurationManager.AppSettings["OptimizePageCount"].ToString()); 
for (int i = 0; i < Convert.ToInt32(ConfigurationManager.AppSettings["PDFFileThrusholdSize"].ToString())) 
continue; 
else 
{ 
//Storing the PDF file in Item Temp path 
this.ClientStatusMessage = string.Format("Saving... {0} ", r2Item.ItemName + "_" + pdfCount.ToString() + ".pdf"); 
doc.Save(tempLocalPDFPath + "\\" + r2Item.ItemName + "_" + pdfCount.ToString() + ".pdf"); 
ListPageCount.Add(r2Item.ItemName + "_" + pdfCount.ToString() + ".pdf", nPageCount); 
pdfCount++; 
nPageCount = 0; 
doc = new Document(); 
AddPDFPage(doc, r2Item.FileList[0].FileBytes); 
nPageCount++; 
} 

} 
finally 
{ 

} 
} 
} 
} 
private void AddPDFPage(Document doc, byte[] fileByte) 
{ 
var currpage = doc.Pages.Add(); 
MemoryStream imageStream = new MemoryStream(fileByte); 
currpage.Resources.Images.Add(imageStream); 
currpage.Contents.Add(new Operator.GSave()); 
Aspose.Pdf.Rectangle rectangle = new Aspose.Pdf.Rectangle(lowerLeftX, lowerLeftY, upperRightX, upperRightY); 
Matrix matrix = new Matrix(new double[] { rectangle.URX - rectangle.LLX, 0, 0, rectangle.URY - rectangle.LLY, rectangle.LLX, rectangle.LLY }); 
currpage.Contents.Add(new Operator.ConcatenateMatrix(matrix)); 
XImage ximage = currpage.Resources.Images[currpage.Resources.Images.Count]; 
currpage.Contents.Add(new Operator.Do(ximage.Name)); 
currpage.Contents.Add(new Operator.GRestore()); 
} 

private void OptimizePDFDocument(ref Document file) 
{ 
Document pdfDocument = file; 
pdfDocument.OptimizeResources(new Document.OptimizationOptions() 
{ 
LinkDuplcateStreams = true, 
RemoveUnusedObjects = true, 
RemoveUnusedStreams = true, 
CompressImages = true, 
ImageQuality = 70 
}); 
file = pdfDocument; 
} 

Thanks
P. Saravanan.


This Topic is created by asad.ali using the Email to Topic plugin.

Hi Saravanan,

Thanks for writing back.

I have tested the scenario with latest version of the API and was able to notice that API was taking long time to process the PDF document(s). As this performance issue has already been logged in our issue tracking system as PDFNET-42755, so I have updated the the issue details with our latest findings.

Please note that we do realize the severity of the issue and for that we have requested the development team to review this issue and share an ETA. We are sure that they will soon provide a fix against your issue, as per their development schedule. As soon as we have some updates in this regard, we will let you know.

Please note that for better technical support, Aspose has switched to new support system which will improve the interaction between Aspose and its valued customers. For new posts or a follow up about existing posts, regarding Aspose.Pdf API, please create a new topic at new [Aspose.Pdf Forums]( Aspose.Pdf Forms).

We are sorry for the delay and inconvenience.


Best Regards,
Asad Ali