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.
Unfortunately, activation email could not send to your email. Please try again.

How to display the saved pdf content in the database.

Thread ID:

Created:

Updated:

Platform:

Replies:

106725 Jan 23,2013 01:33 AM Jan 28,2013 07:52 AM ASP.NET MVC (Classic) 3
loading
Tags: PDF
Arjun Gudla
Asked On January 23, 2013 01:33 AM

Hi,

I am using syncfusion pdf to save the pdf file in to the database. I am saving it to the database. Now i want to display the saved content in the editor. But it is displaying in unreadable format. How can i display the content in correct from the database and i need to update the pdf file and again i want to display that.

Regards,
Srinivas 

George Livingston [Syncfusion]
Replied On January 23, 2013 10:57 PM

Hi Srinivas,

 

Thank you for using Syncfusion products.

 

Can you please provide us the information about the tool you are using to display the PDF document. This would be more helpful for us to further investigate on this. Also provide us the code you are using to create and save the PDF document in the database.

 

Please let us know if you have any concerns.

 

Thanks,

George


Arjun Gudla
Replied On January 24, 2013 11:26 PM

 byte[] buffer = (byte[])data.Name; ()    // where data.name contains bytes from database
PdfLoadedDocument document = new PdfLoadedDocument(ms);
                    string d = "";
                    PdfDocument c = new PdfDocument();

                    foreach (PdfLoadedPage page in document.Pages)
                    {
                         
                        //  document.Save(                          
                        //    d += page.ExtractText();                     // this is for extracting only the text from the pdf document but i am not using this. I want to load the full pdf document

                    }
                    MemoryStream m = new MemoryStream();
                    document.Save(m);
                    m.Seek(0, SeekOrigin.Begin);


                    StreamReader sr = new StreamReader(m, System.Text.Encoding.UTF8);
                    var s = sr.ReadToEnd();
                    pr.text = s;
                    sr.Close();

I am inserting the content in to the textarea or editor. Actually if we have only content in the pdf document it is coming clearly. But, if we have tables or other content other than text it is displaying in some other format like unreadable. Is there any other method to display the content form the database such that tables, images and text will display. Or is there any methods to convert pdf to word.
Hope you understand my question.
Regards,
Srinivas


George Livingston [Syncfusion]
Replied On January 28, 2013 07:52 AM

Hi Srinivas,

Thank you for your update.

We do not have support to extract formatted text from the PDF document. But it is possible to export the PDF as images and render it to the image control.

Please find documentation to Export PDF as image in the below link,

http://help.syncfusion.com/ug/windows%20forms/pdf%20viewer/default.htm#!Documents/exportingpdfsasraste.htm

Please let us know if you have any questions.

Regards,

George

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.

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.

;