Free Support Forum - aspose.com

Lost original formate when display pdf files from sql to asp .net 2010

Hello,

I want to create a pdf file that include some pdf files (user selected from ASP .Net interface). All files saved in SQL Server. When the file was diplayed in ASP .Net, the text and paragraph of the file as same as the original file I have saved before. But words format has been changed (some word lost bold and under line)

PDFList(sTSCode) is a SortedList and stored all pdf file information (from SQL Server) and was saved as MenoeryStream. See below

'Instantiate Pdf pbject by calling its empty constructor

Dim pdf1 As Aspose.Pdf.Generator.Pdf = New Aspose.Pdf.Generator.Pdf()

'Create a new section in the Pdf object

Dim sec1 As Aspose.Pdf.Generator.Section = pdf1.Sections.Add()

'create a new text paragraph and pass the text to its constructor as argumentDim pdfDocument as New Document(DirectCast(PDFList(sTSCode), MemoryStream))

Dim textAbsorber as New TextAbsorber()

pdfDocument.Pages.Accept(textAbsorber)

Dim extractedTex As String = textAbsorber.Text

Dim t As New Aspose.Pdf.Generator.Text(extractedText)

sec1.Paragraphs.Add(t)

Do you have any way to solve this problem?

Hi Bob,


Thanks for your inquiry. Please create your desired file and concatenate the files from MemoryStream, retrieved from Database. Kindly refer following documentation for the purpose. A sample code snippet also attached here to save and retrieve Pdf document to DB using Aspose.Pdf.


Hopefully it will serve the purpose. Please feel free to contact us if there is any difference in our understanding and your requirements.

Best Regards,