PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Apr 26, 2024 6:27 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Apr 26, 2012 6:18 pm 
Offline

Joined: Thu Apr 26, 2012 4:19 pm
Posts: 1
I have html that is coming from database. In html string I have :

<table cellspacing=0 cellpadding=0 width="696" style="border:1px solid black" bgcolor="#c0c0c0">
</table>

It appears that the width = 696 is causing the rendering of the pdf to display only half of the html page.


HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
// Create PDF document
Document pdfDocument = new Document(PageSize.LETTER);

PdfWriter.GetInstance(pdfDocument, HttpContext.Current.Response.OutputStream);

HTMLWorker worker = new HTMLWorker(pdfDocument);

pdfDocument.Open();
worker.Open();
using (StringReader reader = new StringReader(shtml))
{

worker.Parse(reader);
pdfDocument.Close();

}


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 05, 2015 10:07 am 
Offline

Joined: Fri Dec 19, 2014 1:46 am
Posts: 8
So you want to ask the code of html to pdf -textsharp -asp.net, right?
html to textsharp:
http://stackoverflow.com/questions/2516 ... itextsharp
html to asp.net:
http://stackoverflow.com/questions/1445 ... it-without


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 05, 2015 10:50 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
HTML to PDF with PDFsharp:
https://www.nuget.org/packages/HtmlRenderer.PdfSharp/

I haven't tried that tool yet.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 379 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