Create PDF from html - images not resized

2 posts, 0 answers
  1. ian
    ian avatar
    4 posts
    Member since:
    May 2011

    Posted 06 Jul Link to this post

    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);         }     } }

  2. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 07 Jul Link to this post

    Hello Ian,

    We replied in 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

Back to Top