Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nearly transparent images on multiple page pdfs #163

Open
kurtyoder opened this issue Jul 14, 2022 · 2 comments
Open

Nearly transparent images on multiple page pdfs #163

kurtyoder opened this issue Jul 14, 2022 · 2 comments

Comments

@kurtyoder
Copy link

My images render perfectly if the pdf is a single page. If the pdf is longer than that, they are so transparent, they are barely visible.

This occurs when my image source is a file location or a base 64 string. Exporting the html content string to an html file displays the image correctly so it isn't something in my html.

Here is my doc model:

HtmlToPdfDocument doc = new()
     {
         GlobalSettings =
         {
             ColorMode = ColorMode.Color,
             Orientation = Orientation.Portrait,
             PaperSize = PaperKind.Letter,
             Margins = new(15, 15, 15, 15),
             DPI = 300,
             ImageDPI = 900,
             
         },
         
         Objects =
         {
             new ObjectSettings()
             {
                 PagesCount = true,
                 
                 HtmlContent = html,
                 
                 WebSettings = {DefaultEncoding = "utf-8", EnableIntelligentShrinking = false},
                 HeaderSettings = {FontSize = 8, Right = "Page [page] of [toPage]", Left = header, Line = true, Spacing = 2.812}
             }
         }
     };
@islam-nady
Copy link

Any update for this problem ,I have the same problem cannot repeat the image in header of pages if i have more than one page @kurtyoder @gldraphael @rdvojmoc

@aaguileraThub
Copy link

This happen to me a time ago while using a component from syncfusion. It was a weird bug from the webkit engine. I had almos transparent images when the image element were the first thing in the PDF document. The workaround i used was to put a label (or other element that prints something on screen) and made it invisble by setting a font or background color to match the page background color.

you can try that, it may help you with your issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants