Quantcast
Channel: HTML Renderer
Viewing all 693 articles
Browse latest View live

Commented Unassigned: HTML Renderer and PDFSharp [9065]

$
0
0
Hello,

I've downloaded HTML Renderer yesterday, awesome job! HTML Panel is working fine, but I'm trying to use it with PDFSharp, and I'm getting the following error:

Assembly 'HtmlRenderer.PdfSharp, Version=1.5.0.5, Culture=neutral, PublicKeyToken=null' uses 'PdfSharp, Version=1.32.3057.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb' which has a higher version than referenced assembly 'PdfSharp, Version=1.32.2608.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb' ...\HtmlRenderer 1.5.0.5\PdfSharp\NET40\HtmlRenderer.PdfSharp.dll

I'm using the latest PdfSharp, 1.32.3057.0, and I can't find 1.32.2608.0. I tried rebuilding HtmlRenderer.PdfSharp.dll with reference to PdfSharp 1.32.3057.0 and it didn't help.

Thanks for your reply in advance.

dobragab
Comments: Nevermind, installing the HtmlRenderer.PdfSharp via NuGet solved the problem.

New Post: Generate image with background problem

$
0
0
nbrege wrote:
I sort of got it to work. The background image is showing behind the rendered HTML, but it doesn't fill the entire background. It only fills a small portion of the upper-left area. The rest is just black. What am I doing wrong?
@nbreg does your issue fixed? I am having same issue where my image is scaled to small size and html rendered on it but remaining area is just black.

@ArthurTep or @nbregv
Can you please give me a hint to sort-out the issue?

Thanks

New Post: Code to handle image data URIs

$
0
0
Could it be possible to use a base64 uri as a background image also ?

New Post: Render to Image with Transparent Backgroun

$
0
0
is it possible to render the image with a transparent background? I have tried to modify the alpha on the background but can not seem to get it to be transparent without creating a hacky process of setting the background to a color and then removing the color

New Comment on "PDF generation"

Created Unassigned: Pressing space should page down [9066]

$
0
0
Not a major issue, but it would be nice if pressing space caused a page down, as it does in all web browsers.

Commented Unassigned: PDF generation fails for tables with span element [9064]

$
0
0
This is an example of table which contains span element inside cell. Function TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf generates just blank page. In some cases, Adobe Reader even reports that PDF is invalid. Without span it works fine. Due to this bug it's impossible to render Word generated tables to PDF.

```
<table>
<tr><td><span>123</span></td></tr>
</table>
```

Fails also for font and maybe for some other tags.
```
<table>
<tr><td><font>123</font></td></tr>
</table>
```

PS. - Thanks for this great library and keep up that good work!
Comments: Hi, I stumbled across a very similar issue. Even with the home html in the WinForms Demo project the second page of the generated PDF is empty and Adboe reader (tested 10 and 11) occasionally reports an error. Other PDF viewers like gsview or Foxit reader are able to open the document. After analyzing the generated PDF and playing with the renderer source code I found that Adobe reader doesn't like it when a clip path is being set without actually defining a path first. In the PDF file it looks like this (from decoded page content stream): ``` q //push stack W* n //set current path as clip path Q //pop stack ``` I was able to fix it by avoiding to clip to an empty recangle in HtmlRenderer.PdfSharp.Adapters.GraphicsAdapter.PushClip() and HtmlRenderer.PdfSharp.Adapters.GraphicsAdapter.PopClip(): ``` public override void PopClip() { RRect rect = _clipStack.Pop(); if (!rect.IsEmpty) { _g.Restore(); } } public override void PushClip(RRect rect) { _clipStack.Push(rect); if (!rect.IsEmpty) { _g.Save(); _g.IntersectClip(Utils.Convert(rect)); } } ``` Complete changed file is attached. Best regards Lars

New Post: How to load PNG as `byte[]` to HtmlImageLoadEventArgs callback?

$
0
0
I have a PNG from a database as byte[]. How can I set as a HTML image? I use this for PDF creation and the wiki/documentation is sadly lacking...
        public void HandleImageLoad(object sender, HtmlImageLoadEventArgs args)
        {
              var img = LoadFromSource();
                if(img == null)
                {
                    args.Handled = false;
                    args.Callback();
                    Log.Error("Missing image: {0}", args.Src);
                }
                else
                {
                    args.Handled = true;
                    args.Callback(img.Data);
                }                                       
        }

New Post: How to generate PDF with footer and page numbers?

$
0
0
TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdfonly takes a HTML document and lets me set page size and margins. How can I also set a page footer or page numbers from HTML?

New Post: How to load PNG as `byte[]` to HtmlImageLoadEventArgs callback?

$
0
0
For future reference:
The trick is to create a GDI image from a MemoryStream of the PNG picture. That can then be used to create a XImage as callback parameter.
using(var mem = new MemoryStream(img.Data))
{
    System.Drawing.Image sysImg = System.Drawing.Image.FromStream(mem, false, true);
    XImage ximg = XImage.FromGdiPlusImage(sysImg);
    args.Callback(ximg);
}

Created Unassigned: Wrong CSS by copy to HTML clipboard [9067]

$
0
0
Hello,
if i use the following html code with the following stylesheet and copy it to the clipboard the content is wrong. So the color is also used for the single `p` tag. In the html renderer control the color is shown correctly only the clipbord content is not correct.

Source
```
<blockquote>
<p>foo</p>
</blockquote>

<p>bar</p>

```

CSS
```
blockquote p {
color: #f00;
}
```

HTML clipboard content
```
<html>
<body>
<!--StartFragment-->
<blockquote>
<p style="color: #f00;">foo</p>
</blockquote><p style="color: #f00;">bar</p>
<!--EndFragment-->
</body>
</html>
```

The correct content should be
```
<html>
<body>
<!--StartFragment-->
<blockquote>
<p style="color: #f00;">foo</p>
</blockquote><p>bar</p>
<!--EndFragment-->
</body>
</html>
```

Can you please fix this.
Thank you.

Reviewed: 1.5.0.0 (Feb 21, 2015)

$
0
0
Rated 5 Stars (out of 5) - The best library for HTML rendering in .NET world. P.S. It is very sad that project is not supported more.

New Post: TAG HTML inside the is not drawn.

$
0
0
<table>
    <tr>
        <td>
            <span>Text</span>
        </td>
    </tr>
</table>
When I use HTML tag inside the <TD>, TAG is not drawn.

I commented on CSS Default the following line "td, th {border-color: #dfdfdf; overflow: hidden;}" and got success.

Thank you.

Created Unassigned: Support for PDFsharp 1.50 [9068]

$
0
0
Hello. I want use some features of new version PDFsharp, but i also need use HTML Renderer. If i just update PDFSharp, application crash.

New Post: How to have custom controls "with-in" the web page?

$
0
0
Is it possible to have winform controls "embedded" within the pages?

Thanks,
Kris

Created Unassigned: PDF rendering new page issue [9069]

$
0
0
Faced issue with rendering document. Line is splitted into two pages. See attached image![Image](http://s15.postimg.org/uvch2zy63/bug.png)

Created Unassigned: HtmlTooltip doesn't stay open long enough to click a link [9070]

$
0
0
First of all, I love these controls!!! Now to business. I'm using HtmlTooltip to display information including a web link. The controls that are triggering the tooltip are Buttons. The tooltip displays just fine, but when I move my mouse to click on the link in the tooltip, it vanishes.

The vanishing part is expected when the user mouses-off the control, but it makes it difficult when the tooltip doesn't consider itself as an extension of the control's drawing area. What I imagine it should do is as I move my mouse from the button to the tooltip, it will stay open, then I can click the link. This is actually works on the Demo app on the main window, HtmlPanel. The reason it works there is the whole entire panel is the control under the tooltip. Since the tooltip overlaps with the panel, it doesn't consider you moving onto the tooltip moving off the control. But if you tweak the demo app and call SetToolTip on the treeview control to add the tooltip to that, it won't let you move your mouse to the link as long as the portion of the tooltip that has the link is not overlapping with the original control's drawing area.

I hope I'm not confusing anyone. So, is there any way to have the disappearing of the tooltip wait a little longer so that for smaller controls, the user can get their mouse from the control to the tooltip window? And if they're moving their mouse within the tooltip window (even parts that don't overlap with the original control) the tooltip stays up? Thanks a million.

New Post: fonts that aren't installed on system

$
0
0
Hi TheRhinoDude,

Would this solution to add custom fonts work to render as a PDF?

Thanks

Created Unassigned: Paragraph tags in bullet items wrap to newline [9071]

$
0
0
Given the following HTML extract:

<ul>
<li>
<p>Dark and uninviting.</p>
</li>
<li>
<p>Old fashioned dirty looking accommodation</p>
</li>
<li>
</ul>

HtmlRenderer renders the text in <p>...</p> on a separate line from the bullet. Firefox and other browsers correctly render it on the same line.

Can this be fixed please?

New Post: Generate PDF with custom Fonts

$
0
0
Hi,

I am really interested in using HTML Renderer to produce PDF files out of my html reports.

After searching through the code and exemples, I couldn't find any code sample that shows how could I generate an pdf from a html file that uses custom fonts.

I use barcode fonts on my reports and really need it to get exported.

Could anyone guide me in the right direction?

Thanks
Viewing all 693 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>