PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Oct 06, 2024 12:27 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Sep 26, 2024 8:58 am 
Offline

Joined: Fri Aug 09, 2024 5:06 am
Posts: 10
Hi all,
I am using the 6.2 preview version of PDFSharp. When ever i am saving the document with the file size is reducing. While i am checking the fonts attached, the file has more fonts. Is there any way to keep all the fonts and keep the original file size intact?

Thanks,
Hyder


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 26, 2024 9:44 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 990
Location: CCAA
hsikkandar wrote:
Is there any way to keep all the fonts and keep the original file size intact?
It is by design that the file is newly written and that some changes occur.
It is by design that new fonts are added when new text is added.

PDFsharp is open source and if you implement changes that allow PDFsharp to add text while using the available fonts from the PDF file, we will gladly review your pull request.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 26, 2024 10:11 am 
Offline

Joined: Fri Aug 09, 2024 5:06 am
Posts: 10
Thanks Thomas for the prompt reply. I understand while we add new text the font will be added. My query is, the reduction of file size while saving the file after the addition of text?

Thanks
Hyder


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 27, 2024 6:45 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 990
Location: CCAA
hsikkandar wrote:
My query is, the reduction of file size while saving the file after the addition of text?
Maybe I don't get your point.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 27, 2024 10:06 am 
Offline

Joined: Fri Aug 09, 2024 5:06 am
Posts: 10
Hi Thomas,
Thanks for your reply and apologies for not being clear. My doubt was, I was trying to use graphics object of a pdf page to draw a text on the page using PDFSharp library, sometime when we save the file after adding the text using(graphics.DrawString)the actual file size is getting reduced. As far as my understanding , the text drawn using (graphics.DrawString) is being embedded in stream so it will increase the file size . But sometime i am seeing the original file size reduction(For example 70MB to 65MB). what could be the reason?


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 27, 2024 12:10 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 990
Location: CCAA
hsikkandar wrote:
But sometime i am seeing the original file size reduction(For example 70MB to 65MB). what could be the reason?
Streams in the PDF file can be compressed ("zipped") and will be compressed when saved with PDFsharp. This is a lossless process that can reduce the filesize if the original file was not using compression or a lower compression level.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 28, 2024 10:47 am 
Offline

Joined: Fri Aug 09, 2024 5:06 am
Posts: 10
Thanks a lot Thomas for the clarification.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 49 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group