Hello everyone ! I rendered into PDF using HTML, the data content of the Chinese garbled. I ask how to do?
↧
New Post: Html Generate PDF Display text garbled (chinese)
↧
New Post: Html Generate PDF Display text garbled (chinese)
May be you can write your own sample project and paste the primary code here :
[your pdf-converting code here - include chinese chars]
and not the demo application.
:)
[your pdf-converting code here - include chinese chars]
and not the demo application.
:)
↧
New Post: Html Generate Image Symbol sequence of confusion
Hi,
When I use RenderToImage() method generate the image , there is a problem images Content.
html:
Image
However, the correct display should be as follows:
Image
How solve it?
When I use RenderToImage() method generate the image , there is a problem images Content.
html:
string html = "<html><body><table><tr><td style=\"writing-mode:rl-tb;direction:rtl;text-align:right;\">מצופה : %55 אצטט / %45 אקרילי / למטה</td></tr></table><hr/><div align=\"left\" style=\"width: 380px;font-family:Clotex Universal Icon;font-size:30pt\">¶—∆ě∕</div></body></html>";code:
System.Drawing.Image image = HtmlRender.RenderToImage(html);genarete image:
var bitmap = new Bitmap(image);
bitmap.Save(@"D:\Test.png", ImageFormat.Png);
Image
However, the correct display should be as follows:
Image
How solve it?
↧
New Post: None of the provided assemblies can be loaded in the Visual Studio Toolbox
Hi
I was using the HtmlRenderer v1.4.11.0, and now I've tried to update to the last version 1.5.0.6.
The first disgusting problem I found is that I was unable to load the winforms dll into the Visual Studio Toolbox to reference the user-controls, none of the provided dlls can be loaded inside the toolbox by dragging the file inside.
More than that, I found that they can be manually loaded by using the internal toolbox item manager (right click in a category tab > Choose items...) but then, when I try to drag the loaded component into a form, an exception occurs.
If your assemblies still contains components, then why are not loaded when dragging the dll files inside the component toolbox in Visual Studio like any other dll containing a component?.
What happened since v1.4.11.0? why your user-controls can't be loaded as normally? CAN'T USE THEM so just can't build an user-interface with your user-controls (at design time I mean).
I've tested it in Visual Studio 2013 Ultimate, with v1.5.0.5 happens exactlly the same.
I was using the HtmlRenderer v1.4.11.0, and now I've tried to update to the last version 1.5.0.6.
The first disgusting problem I found is that I was unable to load the winforms dll into the Visual Studio Toolbox to reference the user-controls, none of the provided dlls can be loaded inside the toolbox by dragging the file inside.
More than that, I found that they can be manually loaded by using the internal toolbox item manager (right click in a category tab > Choose items...) but then, when I try to drag the loaded component into a form, an exception occurs.
If your assemblies still contains components, then why are not loaded when dragging the dll files inside the component toolbox in Visual Studio like any other dll containing a component?.
What happened since v1.4.11.0? why your user-controls can't be loaded as normally? CAN'T USE THEM so just can't build an user-interface with your user-controls (at design time I mean).
I've tested it in Visual Studio 2013 Ultimate, with v1.5.0.5 happens exactlly the same.
↧
New Post: None of the provided assemblies can be loaded in the Visual Studio Toolbox
I found the problem.
Now the user-control is distributed with one dll dependency, so to be able to load the winforms components the "core" dll should exists in the same directory.
So please put a readme.txt to make things clear with the deployment structure because is totally unclear, what is the purpose of the PdfSharp assembly for example in the context of the Html Renderer control?. Totally unclear, it makes people confussing like I did.
Thanks for read
Now the user-control is distributed with one dll dependency, so to be able to load the winforms components the "core" dll should exists in the same directory.
So please put a readme.txt to make things clear with the deployment structure because is totally unclear, what is the purpose of the PdfSharp assembly for example in the context of the Html Renderer control?. Totally unclear, it makes people confussing like I did.
Thanks for read
↧
↧
New Post: Html Generate Image Symbol sequence of confusion
I found a problem.
If I set the Image Size, the generate Image display normal.
Now the problem is that I don't know the height of the image.
How can I calculate the height of html?
If I set the Image Size, the generate Image display normal.
System.Drawing.Image image = HtmlRender.RenderToImage(html, new System.Drawing.Size(400, 200));
Now the problem is that I don't know the height of the image.
How can I calculate the height of html?
↧
New Post: How to use the HTML Renderer in Windows 10 UWP?
The start page of this project suggests that the HTML Renderer can be used in Windows "Metro". But I don't find any information on how to use the controls in a Windows 10 UWP App.
It seems like the Windows 10 UWP controls are not implemented (yet)?
It seems like the Windows 10 UWP controls are not implemented (yet)?
↧
New Post: Pagination
I was wondering if HTMLRenderer supports any form of page numbers.
Any pointers are welcome, as I could not find anything about that.
And Thanks for the great tool!
Any pointers are welcome, as I could not find anything about that.
And Thanks for the great tool!
↧
New Post: Debugging Generated PDFs
Yes! that exatly the problem i having.
It manifests only when generating the PDF.
In the viewer it looks fine.
It just refuses to work :(
It manifests only when generating the PDF.
In the viewer it looks fine.
It just refuses to work :(
↧
↧
New Post: Debugging Generated PDFs
Chagui wrote:
Yes! that exatly the problem i having.Nevermind, it worked with the latest version from github.
It manifests only when generating the PDF.
In the viewer it looks fine.
It just refuses to work :(
↧
New Post: Binding BaseStylesheet and updating it
Hi there,
I am using the WPF version of the HtmlPanel control - and I love it, except for this one problem I have.
I have a stylesheet that might change (user configures a different theme), but when I update the property, nothing happens.
Now, if I resize the window, causing the control to redraw itself, THEN it will do so with the new stylesheet.
Is there a way to properly have it redraw itself whenever there is a change to the bound BaseStylesheet property? It would of course be lovely if it could do that itself...
I am using the WPF version of the HtmlPanel control - and I love it, except for this one problem I have.
I have a stylesheet that might change (user configures a different theme), but when I update the property, nothing happens.
Now, if I resize the window, causing the control to redraw itself, THEN it will do so with the new stylesheet.
Is there a way to properly have it redraw itself whenever there is a change to the bound BaseStylesheet property? It would of course be lovely if it could do that itself...
↧
New Post: How to embed fonts using HtmlRenderer.PDFSharp ?
Hi,
I'm using HtmlRenderer.PDFSharp to render to pdf file but how do I embed the fonts into the pdf?
I'm testing using the 02.Text.htm file.
The sample WinForm app works fine but when I code it myself, some characters became rectangles.
I also tried a file with Simplified Chinese and it all came out rectangles.
Any ideas?
Thanks.
I'm using HtmlRenderer.PDFSharp to render to pdf file but how do I embed the fonts into the pdf?
I'm testing using the 02.Text.htm file.
The sample WinForm app works fine but when I code it myself, some characters became rectangles.
I also tried a file with Simplified Chinese and it all came out rectangles.
Any ideas?
Thanks.
↧
New Post: Page Break Always is not functional
Hey guys,
I'm inserting a div element with the attribute page-break-always: after to force a page break from that point and separate the content before with the content after. This should result in multiple pages, however the converted PDF document I receive does not produce the page break as expected.
Please fix this issue, I'm using the GeneratePdf method in namespace, TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator, passing in the html string and configurations.
Best regards,
Adhy
I'm inserting a div element with the attribute page-break-always: after to force a page break from that point and separate the content before with the content after. This should result in multiple pages, however the converted PDF document I receive does not produce the page break as expected.
Please fix this issue, I'm using the GeneratePdf method in namespace, TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator, passing in the html string and configurations.
Best regards,
Adhy
↧
↧
New Post: Left margin applies to second line of bullet
When trying to render the following bullet item the bullet gets a left margin of 20px as it should but when the text goes to the next line, it is again indented.
<ul style="width: 100px">
<li style="margin: 0 0 0 20px">asdf asdf asdf asd fas df </li>
</ul>
↧
New Post: CSS3 Support
Are there any plans to support CSS3 and what might be the timeline for its release?
↧
New Post: How to generate PDF with footer and page numbers?
Hello!
Thank you for the geat work!
I too join the question, is there any tools to customize PDF (header, footer, pages etc)?
Thank you for the geat work!
I too join the question, is there any tools to customize PDF (header, footer, pages etc)?
↧
New Post: Use an existing PDF as template
Hi there,
is it possible to open an existing PDF as a template, and place the html on that template?
I can't find a way to do that.
is it possible to open an existing PDF as a template, and place the html on that template?
I can't find a way to do that.
↧
↧
New Post: Script injection threat?
Hi,
I'm considering using this project to render HTML coming from an end-user rich text editor into images to display in reports. I'll use the HtmlRender.RenderToImage() method.
From a security perspective I just want to ensure nothing bad could happen e.g. if an end-user somehow injected malicious JavaScript into the HTML. I can't find any documentation in relation to this. Is this a risk and if so does HTML Renderer protect against it?
Can someone familiar with HTML Renderer share their thoughts on this?
I'm considering using this project to render HTML coming from an end-user rich text editor into images to display in reports. I'll use the HtmlRender.RenderToImage() method.
From a security perspective I just want to ensure nothing bad could happen e.g. if an end-user somehow injected malicious JavaScript into the HTML. I can't find any documentation in relation to this. Is this a risk and if so does HTML Renderer protect against it?
Can someone familiar with HTML Renderer share their thoughts on this?
↧
New Post: CSS word-break : break-word vs break-all
I have a situation where I have td elements with a fixed width. If a word happens to be long enough that it will exceed the width of the cell, it will be placed on a new line.
However, if there is a single word on the new line, and that word exceeds the td width, that word will go past the boundary and be cutoff.
word-break:break-all takes care of this by breaking the word at the first letter that crosses they boundary, but word-break:break-word takes the whole word and moves it to the next line.
Is there any way to have the best of both worlds? I want the break-word functionality but I would like break-all if there is only one word on a line that exceeds the boundary.
Thanks!
However, if there is a single word on the new line, and that word exceeds the td width, that word will go past the boundary and be cutoff.
word-break:break-all takes care of this by breaking the word at the first letter that crosses they boundary, but word-break:break-word takes the whole word and moves it to the next line.
Is there any way to have the best of both worlds? I want the break-word functionality but I would like break-all if there is only one word on a line that exceeds the boundary.
Thanks!
↧
New Post: Images don't display in PDF
I have a fairly simple HTML page rendered via asp.net. It look beautiful in the PDF after running it through HtmlRenderer.PdfSharp EXCEPT that the images don't appear. Just the red X of a missing image in the PDF even though the web page itself does display the image correctly.
Here is my HtmlRenderer.PdfSharp code:
How can I solve this?
Here is my HtmlRenderer.PdfSharp code:
public void BuildPDF( string url, string pdfPath ) {
string html = GetHTML(url);
Byte[] res = null;
using( MemoryStream ms = new MemoryStream() ) {
using( FileStream file = new FileStream(pdfPath, FileMode.Create, FileAccess.Write) ) {
byte[] bytes = new byte[ms.Length];
var pdf = TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf(html, PdfSharp.PageSize.A4);
pdf.Save(ms);
res = ms.ToArray();
file.Write(res, 0, res.Length);
ms.Close();
}
}
}
private string GetHTML(string url) {
string html = string.Empty;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.AutomaticDecompression = DecompressionMethods.GZip;
using( HttpWebResponse response = (HttpWebResponse)request.GetResponse() )
using( Stream stream = response.GetResponseStream() )
using( StreamReader reader = new StreamReader(stream) ) {
html = reader.ReadToEnd();
}
return html;
}
And here is the img html that doesn't render in the PDF: <img src="images/ChartImg.png" />How can I solve this?
↧
More Pages to Explore .....