PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 20, 2024 4:01 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Document Save Stream
PostPosted: Mon Feb 17, 2014 3:02 pm 
Offline

Joined: Tue Mar 20, 2007 9:46 am
Posts: 6
Hello, i have a question:

i write one pdf with about 15.000 pages, but after about 10000 i receive a OutMemoryException.
Then i decide to write one pdf with a stream every pages :

_document.Save(stream, false);
using (FileStream file = new FileStream(Path.Combine(_tmp_path, "Prova.pdf"), FileMode.Append))
{
file.Write(stream.ToArray(),0, stream.ToArray().Length);
}

But if i open a pdf create, i view the last pages inserted, and not all; this because where i save the document the pdfsharp insert a EOF command.
Can i write a pdf correctly?

Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: Document Save Stream
PostPosted: Mon Feb 17, 2014 3:14 pm 
Offline
PDFsharp Guru
User avatar

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

You cannot create a huge PDF file by saving multiple small PDF files in one stream (not sure that's what you are trying).

Are you running a 64 bit application on a 64 bit operating system?
64 bit applications can use more memory than 32 bit applications.
So if you have a 64 bit operating system but use a 32 bit application, compile your application as 64 bit.

Something else you could try:
1. Create a new PDF document, add 1000 pages, save it, close it.
2. Open it, append up to 1000 new pages, save it, close it.
Repeat 2 until all pages have been added. AFAIK this will reduce the memory consumption.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 293 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