Hi, I have just started using PDF Sharp to create a little tool here in the office. Its a c# written application that runs from Autodesk Revit product, and it splits a PDF file and then directly renames the file to match a drawing and project number and revision. I got the split and naming to work (wow thanks saves a ton of work") however I do not understand why the file size of the split PDFs are almost equal in size to the original file? How is this possible and how can I prevent that? they are vector printed drawings, although some are raster images (which are actually smaller than the vector ones).
the code I use to create the split is as follows:
Code:
for (int idx = 0; idx < inputDocument.PageCount; idx++)
{
// Create new document
PdfDocument outputDocument = new PdfDocument();
outputDocument.Version = inputDocument.Version;
outputDocument.Info.Title = String.Format("Page {0} of {1}", idx + 1, inputDocument.Info.Title);
outputDocument.Info.Creator = inputDocument.Info.Creator;
// Add the page and save it
outputDocument.AddPage(inputDocument.Pages[idx]);
// Get name through Revit API
FileName = GetFileName();
if (File.Exists(directory + FileName + ".pdf"))
{
OverwrittenNamesString.Add(FileName);
}
outputDocument.Save(Path.Combine(directory, FileName + ".pdf"));
iCount++;
}
See the screenshot showing the original file (55 Moorgate - Demolition pdf) D004 to D006 are raster images and the other vector ones.
funny enough D201 is small again althou almost identical to D200.
Thanks if anybody can help.