PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Jun 19, 2019 3:13 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed May 08, 2019 11:24 am 
Offline

Joined: Wed May 08, 2019 10:14 am
Posts: 3
Hello everyone,

I work with an array of PDFDocuments
Code:
PdfDocument[] results;
.
Is there a way to merge this array of documents to one big PDFDocument without writing it to the disk?

I have already tried to create an array of pages and add them to a document but I can't because they must belong to a document.
I already searched in the web and went over these solutions which did not help me because I do not want to write the PDF to disk before merging them.

http://www.pdfsharp.net/wiki/Concatenat ... ample.ashx
http://pdfsharp.com/PDFsharp/index.php% ... temid%3D60
http://pdfsharp.net/wiki/CombineDocuments-sample.ashx

I work with version 1.51.5185-beta

Cheers and thanks for the help


Top
 Profile  
Reply with quote  
PostPosted: Wed May 08, 2019 12:41 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2945
Location: Cologne, Germany
You can write the PDFs to MemoryStream objects if you do not want to write them to disk.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed May 08, 2019 3:34 pm 
Offline

Joined: Wed May 08, 2019 10:14 am
Posts: 3
But then I would have to write all pdfs to memory stream just to afterwards read them again. Is there no way to use PDFDocuments directly? I have to work with massive amounts of PDF's and being time efficient is very important for my project.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 08, 2019 4:42 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2945
Location: Cologne, Germany
PAquaticus wrote:
Is there no way to use PDFDocuments directly?
Why do you create multiple files in the first place? Simply create one big file right from the start.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon May 13, 2019 8:39 am 
Offline

Joined: Wed May 08, 2019 10:14 am
Posts: 3
Thomas Hoevel wrote:
PAquaticus wrote:
Is there no way to use PDFDocuments directly?
Why do you create multiple files in the first place? Simply create one big file right from the start.


Because I want to create up to a million pdf's in as little time as possible for a project I am working on. I have time restrictions so I have to make use of everything I can. Therefore I create the pdf's in parallel. But writing every single one to the disk does bottleneck. My Nvme can handle many iop's but I read in other posts in this forum that Pdfsharp is not threadsafe which still appears to be true in my case. So I would like to concatenate them and write them as one big file.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 13, 2019 4:06 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2945
Location: Cologne, Germany
PAquaticus wrote:
My Nvme can handle many iop's but I read in other posts in this forum that Pdfsharp is not threadsafe which still appears to be true in my case.
Sounds as if you are not sure whether PDFsharp is threadsafe.
AFAIK the only issues are with font handling - and there are known workarounds. Posts about version 1.32 and older can be outdated.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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