This is a migrated thread and some comments may be shown as answers.

Create PDF from html - images not resized

1 Answer 220 Views
WordsProcessing
This is a migrated thread and some comments may be shown as answers.
ian
Top achievements
Rank 1
ian asked on 06 Jul 2016, 08:30 AM

Hi,

I am creating an pdf document from an html, which contains a number of images. I notice a difference between the pdf created and when viewing the html in a browser. For example the html contains css to resize the images, however it appears this does not happen during the pdf conversion process, so the images look too big.

Thanks

I use the code below to create the pdf

try {     using (var inputHtml = new MemoryStream(htmlEncoding.GetBytes(sourceString)))     {         var htmlProvider = new HtmlFormatProvider();         var document = htmlProvider.Import(inputHtml);         var editor = new RadFlowDocumentEditor(document);         using (Stream output = new FileStream(targetFolder + targetFilename, FileMode.OpenOrCreate))         {             var pdfProvider = new PdfFormatProvider();             pdfProvider.Export(document, output);         }     } }

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 07 Jul 2016, 01:23 PM
Hello Ian,

We replied the support thread and I will suggest you continue the conversation there as we will need some additional details on the scenario in order to check what may cause this behavior.

Regards,
Tanya
Telerik by Progress

Tags
WordsProcessing
Asked by
ian
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or