PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Apr 25, 2024 1:49 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Tue Nov 04, 2014 2:41 pm 
Offline

Joined: Tue Nov 04, 2014 2:27 pm
Posts: 5
Hi,

We are going to use PdfSharp open source to merge PDF files.

In PdfSharp open source iTexSharp.dll also used.

We want to know what is the use of iTextSharp.dll in PdfSharp open source. :( :( :(

And also want to know what is the impact, if we don't use iTextSharp.dll. :( :( :(

Kindly let as know about iTextSharp.dll use in PdfSharp open source.

Thank in advance. :) :) :)

Note:
We are merging 1.3 and 1.4 PDF file.

With regards,
Venugopal.D


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 04, 2014 3:28 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Hi!
Venugopal.D wrote:
In PdfSharp open source iTexSharp.dll also used.
Where?
AFAIK iTexSharp.dll is not used in PDFsharp.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 05, 2014 5:55 am 
Offline

Joined: Tue Nov 04, 2014 2:27 pm
Posts: 5
Hi,

Kindly find the attachment. I indicated in red color box.

In PdfSharp mentioned as Workaround, see below code.
--------------------------------------------------------------------
static public PdfDocument Open(MemoryStream sourceStream, PdfDocumentOpenMode openmode)
{
PdfDocument outDoc = null;
sourceStream.Position = 0;

try
{
outDoc = PdfReader.Open(sourceStream, openmode);
}
catch (PdfSharp.Pdf.IO.PdfReaderException)
{
//workaround if pdfsharp doesn't support this pdf
sourceStream.Position = 0;
MemoryStream outputStream = new MemoryStream();
iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(sourceStream);
iTextSharp.text.pdf.PdfStamper pdfStamper = new iTextSharp.text.pdf.PdfStamper(reader, outputStream);
pdfStamper.FormFlattening = true;
pdfStamper.Writer.SetPdfVersion(iTextSharp.text.pdf.PdfWriter.PDF_VERSION_1_4);
pdfStamper.Writer.CloseStream = false;
pdfStamper.Close();

outDoc = PdfReader.Open(outputStream, openmode);
}

return outDoc;
}

--------------------------------------------------------------------

With regards,
Venugopal.D


Attachments:
Image_iTextSharp_Marked_05NOV14.jpg
Image_iTextSharp_Marked_05NOV14.jpg [ 241.59 KiB | Viewed 11109 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 05, 2014 8:54 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Venugopal.D wrote:
In PdfSharp mentioned as Workaround, see below code.
This is not part of the official PDFsharp distribution.
PDFsharp does not use iTextSharp.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 05, 2014 9:39 am 
Offline

Joined: Tue Nov 04, 2014 2:27 pm
Posts: 5
Hi Thomas Hoevel,

Thanks for your quick response. :) :) :)

Where can i get PdfSharp open source code without using iTextSharp.dll.

Kindly refer me a link where PdfSharp open source available, which more useful to me.


With regards,
Venugopal.D


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 05, 2014 10:17 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
You can find the releases here:
http://pdfsharp.codeplex.com/releases

Where did you get your version?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 05, 2014 11:14 am 
Offline

Joined: Tue Nov 04, 2014 2:27 pm
Posts: 5
Hi Thomas Hoevel,

This is the link where i got the source.
http://sourceforge.net/projects/pdfmerge/


I want to know can i merge two or more PDF file using PdfSharp open Source which was sent by you. :?:
http://pdfsharp.codeplex.com/releases


Please let me know. :( :( :(


With regards,
Venugopal.D


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 05, 2014 12:47 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Check the "Concatenate Documents" sample:
http://www.pdfsharp.net/wiki/Concatenat ... ample.ashx
Variant1 shows the required steps.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 14, 2014 5:29 am 
Offline

Joined: Tue Nov 04, 2014 2:27 pm
Posts: 5
Hi Thomas Hoevel,

I really appreciate your quick response and thanks for your valuable support.

It is working fine, without out any problem.


With regards,
Venugopal.D


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

All times are UTC


Who is online

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