PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Need to know PdfSharp with iTextSharp.dll
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2971
Page 1 of 1

Author:  Venugopal.D [ Tue Nov 04, 2014 2:41 pm ]
Post subject:  Need to know PdfSharp with iTextSharp.dll

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

Author:  Thomas Hoevel [ Tue Nov 04, 2014 3:28 pm ]
Post subject:  Re: Need to know PdfSharp with iTextSharp.dll

Hi!
Venugopal.D wrote:
In PdfSharp open source iTexSharp.dll also used.
Where?
AFAIK iTexSharp.dll is not used in PDFsharp.

Author:  Venugopal.D [ Wed Nov 05, 2014 5:55 am ]
Post subject:  Re: Need to know PdfSharp with iTextSharp.dll

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 11144 times ]

Author:  Thomas Hoevel [ Wed Nov 05, 2014 8:54 am ]
Post subject:  Re: Need to know PdfSharp with iTextSharp.dll

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.

Author:  Venugopal.D [ Wed Nov 05, 2014 9:39 am ]
Post subject:  Re: Need to know PdfSharp with iTextSharp.dll

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

Author:  Thomas Hoevel [ Wed Nov 05, 2014 10:17 am ]
Post subject:  Re: Need to know PdfSharp with iTextSharp.dll

You can find the releases here:
http://pdfsharp.codeplex.com/releases

Where did you get your version?

Author:  Venugopal.D [ Wed Nov 05, 2014 11:14 am ]
Post subject:  Re: Need to know PdfSharp with iTextSharp.dll

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

Author:  Thomas Hoevel [ Wed Nov 05, 2014 12:47 pm ]
Post subject:  Re: Need to know PdfSharp with iTextSharp.dll

Check the "Concatenate Documents" sample:
http://www.pdfsharp.net/wiki/Concatenat ... ample.ashx
Variant1 shows the required steps.

Author:  Venugopal.D [ Fri Nov 14, 2014 5:29 am ]
Post subject:  Re: Need to know PdfSharp with iTextSharp.dll

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/