PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Mar 29, 2024 5:08 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Jul 08, 2010 3:29 pm 
Offline

Joined: Tue Jun 08, 2010 6:12 pm
Posts: 13
Hello,

I have a group of vector drawings (a symbol) that can appear multiple times though out a document. This symbol can be repeated several thousand times depending on the users data. I am trying to determine the most efficient way to draw this to my PDF. Drawing performance is important, but I am also trying to keep the file size as small as possible. Also, the drawings need to be vector and not rasterized.

I know in a PDF, once you add an image to the document, that image can be used in multiple times without having to add multiple copies of that image to the document. I am basically looking for a way to do this, but with vector drawings, not raster. I would like to draw the vector drawings once, and then tell the PDF to reference that drawing for the subsequent draws.

Anybody know of a way to do this or have a better idea?

Thanks
Craig


Last edited by jccapps on Thu Jul 08, 2010 4:20 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 08, 2010 3:50 pm 
Offline

Joined: Wed Jul 07, 2010 11:17 am
Posts: 9
:D

I'm with you here.

Was looking for a similar solution too, didn't find one (yet...).


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 09, 2010 5:38 pm 
Offline

Joined: Tue Jun 08, 2010 6:12 pm
Posts: 13
Hey omrisela,

I'm not sure if this is the best way to do it or not, but after some investigation I've decided to use the XForm object to group my vector drawings. In one of my test cases I saw a 252% file size decrease when I drew my vectors to a XForm and then drew the XForm to the PDF, as opposed to drawing the vectors straight to the PDF.

It seems that in my test cases, for every XForm you add to the PDF, the document size increase by about 30 - 40 kb (I'm sure it really depends on what all you are drawing to the XForm so this number could get much higher). So if you just have something you are drawing once or twice it may not be worth it. However, if you are drawing something thousands of times like I am, you may want to look into it.

If you come up with any ideas, please share them.

Craig


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 12, 2010 7:45 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!

XForm would also be my suggestion.

When comparing file sizes, always use the Release build (the Debug build creates verbose PDF files that are larger).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 12, 2010 1:19 pm 
Offline

Joined: Tue Jun 08, 2010 6:12 pm
Posts: 13
Thanks Thomas!

I was using debug mode and when I switched to release mode I saw a very significant file size drop!

Craig


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 148 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:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group