LayoutFarm / HtmlRenderer

C# HTML Layout and HTML Rendering Engine
http://layoutfarm.github.io/HtmlRenderer/
Other
187 stars 40 forks source link

System.DllNotFoundException #9

Closed reginoprado closed 6 years ago

reginoprado commented 7 years ago

Hello

I have this error I my widnows 10 when i tried to run the demo. VS2015 and VS2017:

System.DllNotFoundException occurred HResult=0x80131524 Message=Unable to load DLL 'myft.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Other thing could you write example to convert html to image? I need to render piece of HTML to image to be used in asp.net apps and i would like to use google fonts with link tag

I used before https://github.com/ArthurHub/HTML-Renderer but the HTML and css is poor for what I need

Cheers

PD: Other: System.TypeInitializationException occurred HResult=0x80131534 Message=The type initializer for 'LayoutFarm.UI.UISurfaceViewportControl' threw an exception. Source= StackTrace:

Inner Exception 1: TypeInitializationException: The type initializer for 'LayoutFarm.UI.UIPlatformWinForm' threw an exception. Inner Exception 2: BadImageFormatException: Could not load file or assembly 'PixelFarm.Drawing.Skia, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
prepare commented 7 years ago

@reginoprado

sorry for that inconvenient.

some parts of HtmlRenderer needs https://github.com/PaintLab/PixelFarm


'myft' is my cpp wrapper of FreeType , HarzBuff and some native image lib.

the source code of 'myft.dll' see => https://github.com/PaintLab/PixelFarm/tree/master/a_mini/external/myfonts

the prebuilt binary, 32 bits see => https://github.com/PaintLab/PixelFarm/tree/master/a_mini/external/dlls


for PixelFarm.Drawing.Skia ,

=> give me a time to review the code again.

prepare commented 7 years ago

@reginoprado

Other thing could you write example to convert html to image? I need to render piece of HTML to image to be used in asp.net apps and i would like to use google fonts with link tag

for your server + asp.net apps,

Do you run it on your Windows 10?

reginoprado commented 7 years ago

Yes, windows 10

prepare commented 6 years ago

Hello, @reginoprado

Sorry for late reply, many things have been update in the repo.

see this at https://github.com/LayoutFarm/HtmlRenderer/tree/2d9f221884bce8695bcca53cf12bb777c50c0d72

  1. The latest update dose not need 'myft.dll' anymore, I remove it -- :)

and ... 2.

... Other thing could you write example to convert html to image? I need to render piece of HTML to image ...


How to Save Html Surface to a file

In this version, We can render to Win32 HDC surface (eg. Memory HDC) and the save to the image file or you can put the image's pixel buffer to another surface eg OpenGL texture surface

html_snap1 _pic 1: (1) run test3MixHtml project, select 00.html example (2)


html_snap2

pic 2: the test acid 1 screen


html_snap3

pic 3: switch back to the main form, click 'save' button (3) to save the html screen to file


Where is the file?, just see the code ...

html_snap0 pic 4: the code behind that 'save' button

the code above works, but just for example only. I test it with WindowForms only. But I think apply it to asp.net is not hard.