PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Important Notice: We regret to inform you that our free phpBB forum hosting service will be discontinued by the end of June 30, 2024. If you wish to migrate to our paid hosting service, please contact billing@hostonnet.com.
Adding simple text increasing size of PDF dramatically

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
sidpoonja



Joined: 21 Aug 2008
Posts: 2
Location: New York

PostPosted: Fri Aug 22, 2008 11:23 am    Post subject: Adding simple text increasing size of PDF dramatically Reply with quote

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()
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Mon Aug 25, 2008 7:33 am    Post subject: Reply with quote

Are you using a DEBUG build of PDFsharp?
Have you tried a RELEASE build?
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
sidpoonja



Joined: 21 Aug 2008
Posts: 2
Location: New York

PostPosted: Mon Aug 25, 2008 11:19 pm    Post subject: Reply with quote

Hi Thomas,

Thanks for your reply. I was able to fix the problem. After I got a reference to the PDFDocument object, I set two of its properties:

PDFDocument.CompressContentStreams = True
PDFDocument.NoCompression = False

and that seemed to do the job. Now the size of the new PDF is only marginally larger than the original PDF (which is expected).
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com