Dear all,
I am making a windows service that removes blank pages from PDF files that were dropped in a folder.
I am using the aspose.PDF library to do this:
foreach (FileInfo PDFfile in INfolder.GetFiles(“*.pdf”))
{
List blancPageNumbersList = new List();
using (Aspose.Pdf.Document pdfDocument = Arco.AsposeWrappers.Pdf.GetDocument(PDFfile.FullName))
{
try
{
foreach (Page page in pdfDocument.Pages)
{
if (page.IsBlank(0.01))
{
blancPageNumbersList.Add(page.Number);
}
}
int[] blancPageNumbers = blancPageNumbersList.ToArray();
pdfDocument.Pages.Delete(blancPageNumbers);
}
}
Some PDF’s are processed correctly by the service, but others are not. When I use the online service you provide (Remove Blank Page In PDF Online) to remove blank pages, all PDF files are processed correctly. Is it possible to share the code behind this service that is relevant for my problem? (treshold value, way of processing etc)
Many thanks in advance!