We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDF Viewer and importing streams

Thread ID:

Created:

Updated:

Platform:

Replies:

69069 Oct 11,2007 08:49 PM UTC Apr 30,2008 09:44 AM UTC WinForms 5
loading
Tags: PDF
Steve Neal
Asked On October 11, 2007 08:49 PM UTC

Does syncfusions pdf tool have the ability to import a stream.

Saravanan A [Syncfusion]
Replied On October 20, 2007 10:26 AM UTC

Hi Steve,

Yes. Essential PDF has the ability to import the data from stream object.

With version 5.1 and earlier you can use the following code to import/export a PDF from the stream object


//To import from stream
PDFDocument pdfDoc = new PDFDocument(streamObject);

//To export to stream
byte[] buffer=new byte[1105];
MemoryStream stream=new MemoryStream(buffer);
pdfDoc.Save(stream);


In version 5.2, we have completly changed the implementation of PDF. Currently it supports only to create and save the PDF and it don't have support to open an existing PDF files. However we will implement this support in our next release.
With this version also you can use the above mention code to save the PDF to memory stream.

Please let me know if you need more information.

Regards,
Saravanan

Mark
Replied On December 3, 2007 09:53 PM UTC



OK, now we have the next release, are we able to open an existing PDF? I have had a quick look in the online documentation but don't see anything.


Administrator [Syncfusion]
Replied On December 5, 2007 02:25 PM UTC

Hi Steve,

We regret to let you know that feature to open an existing PDF has not been implemented in v6.1. We will get back to you once this feature is implemented.

Please let me know if you have any concerns.

Thanks,
Melba


Jim Wilson
Replied On January 11, 2008 09:10 PM UTC

The ability to open an existing PDF file is critical for me. The ONLY reason I purchased your component was to open files, stamp a license statement at the top of each page, set user and owner passwords, and then save the file. I just spent three hours upgrading to the latest version and then trying to figure out how to "fix" my code only to learn hear that what I need is no longer supported.

This seems like a huge step backwards. Am I missing something?


Yavanaarasi G [Syncfusion]
Replied On April 30, 2008 09:44 AM UTC

Hi Jim,

Sorry for the delay in responding.

We can open the existing pdf in our latest version Essential Studio 2008 Volume 2. As per your requirements I have created one sample with open an existing Pdf and stamp a statement at the top of each page and set user and owner passwords. Please refer below code:


[C#]
PdfLoadedDocument lDoc = new PdfLoadedDocument(txtUrl.Text);
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 36f);
//Insert stamp
foreach (PdfPageBase lPage in lDoc.Pages)
{
PdfGraphics g = lPage.Graphics;
PdfGraphicsState state= g.Save();
g.SetTransparency(0.25f);
g.DrawString(txtStamp.Text, font, PdfPens.Red, PdfBrushes.Red, new PointF(10, 10));
}

//Security
PdfSecurity security = lDoc.Security;
security.KeySize = PdfEncryptionKeySize.Key128Bit;
security.OwnerPassword = "syncfusion";
security.Permissions = PdfPermissionsFlags.Print | PdfPermissionsFlags.FullQualityPrint;
security.UserPassword = "password";


Here is the sample:

http://websamples.syncfusion.com/samples/PDF.Windows/F-69069/main.htm

Please refer the documentation link below for how to open an existing document:

http://www2.syncfusion.com/ug_62/pdf/default.html

Please try this and let me know if this helps.

Regards,
G.Yavana




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;