I have an application that uses a GIS framework to export a PDF document (which is basically a map). I then need to stamp this PDF with some custom information (just two lines of simple text) for which I use PDFSharp and create a new PDF document. The utility works great. The only problem is that the size of the resultant document (created by PDFSharp) is so much larger. For eg: one PDF file that was orginally 184KB became 712KB when created with PDF Sharp. Now the PDF Exporter of the GIS framework has a DPI setting. Is there something similar with PDFSharp?
here is the code i used to generated the PDF.
pdfDocument = PdfReader.Open(inputFile)
For Each page As PdfPage In pdfDocument.Pages
Dim xgfx As XGraphics = XGraphics.FromPdfPage(page)
xgfx.DrawString("As of Date : " + effectiveDate, dateFont, XBrushes.Black, effDateLocation)
page.Close()
Next
pdfDocument.Save(outputFile)
pdfDocument.Close()
|