Hello,
I am creating a RadFixedDocument from a byte array, and removing a single page.If I save the original byte array to a PDF document the file size is 214 KB, but the files size of the document after removing the first page is 563 KP. Any recommendations on how I can reduce the file size?
Utility.RemovePages(polDocResponse);
public static void RemovePages(PolicyDocument polDocResponse, int numPages = 1)
{
PdfFormatProvider provider = new PdfFormatProvider();
RadFixedDocument srcDocument = provider.Import(new MemoryStream(polDocResponse.DocumentValue));
if (numPages >= srcDocument.Pages.Count)
throw new ArgumentException(
string.Format("Utility.RemovePages: Number of pages to remove {0} is greater than or equal to the number of pages in the document {1}.",
numPages.ToString(), srcDocument.Pages.Count.ToString()));
for (int i = 0; i < numPages; i++)
{
srcDocument.Pages.RemoveAt(i);
}
polDocResponse.DocumentValue = provider.Export(srcDocument);
}