Recent

Author Topic: HtmlViewer  (Read 10519 times)

MISV

  • Hero Member
  • *****
  • Posts: 792
HtmlViewer
« on: November 18, 2017, 11:06:42 pm »
I found this

https://github.com/BerndGabriel/HtmlViewer

which claims Lazarus compability and newer codebase compared to HmlPort conversion http://wiki.freepascal.org/THtmlPort of the original commercial HTML viewer.

However - this does not seem to compile easily on Lazarus 1.6.4 / Carbon. Missing package, missing Mac defines (e.g. fonts) and I seemingly also have errors with defines usage although I do not understand why the error triggers.

Are anyone using HtmlViewer for Lazarus / Mac / Carbon?

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: HtmlViewer
« Reply #1 on: November 19, 2017, 12:11:58 am »
Have you contacted the developer of the component?
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: HtmlViewer
« Reply #2 on: November 19, 2017, 12:13:57 am »
Try Chrome Embedded Framework, if works for your target platforms is the most advanced viewer you can get.

MISV

  • Hero Member
  • *****
  • Posts: 792
Re: HtmlViewer
« Reply #3 on: November 19, 2017, 01:40:28 am »
Try Chrome Embedded Framework, if works for your target platforms is the most advanced viewer you can get.

I thought about this, but I concluded my executable would increase massively in size? (like 100-200mb) But I see others cherry picking what they need.  Maybe I should look into this again... Thanks

MISV

  • Hero Member
  • *****
  • Posts: 792
Re: HtmlViewer
« Reply #4 on: November 19, 2017, 01:42:48 am »
Have you contacted the developer of the component?

Just posted two bugs (I believe they are bugs) + the thing mentioned in this post today on the "issues" GitHub forum board.

Offhand, I would say the Renderer is much better than TIpHtmlPanel - still learning it - but got everything working fairly well albeit I had to work around a few issues
« Last Edit: November 19, 2017, 11:33:54 am by MISV »

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: HtmlViewer
« Reply #5 on: November 19, 2017, 02:41:22 am »
I found this

https://github.com/BerndGabriel/HtmlViewer

I just ran its JavaScript demo "FrameDemJavaScriptUsingBesen" using its trunk version. It uses BeRo's BESEN. Needed a few changes to get it to compile. Like adding LCLPlatformDef to HtmlMisc's uses section.

Edit:
Lazarus package is named FrameViewer09.lpk
« Last Edit: November 19, 2017, 02:56:54 am by engkin »

MISV

  • Hero Member
  • *****
  • Posts: 792
Re: HtmlViewer
« Reply #6 on: November 19, 2017, 01:55:34 pm »
I found this

https://github.com/BerndGabriel/HtmlViewer

I just ran its JavaScript demo "FrameDemJavaScriptUsingBesen" using its trunk version. It uses BeRo's BESEN. Needed a few changes to get it to compile. Like adding LCLPlatformDef to HtmlMisc's uses section.

Edit:
Lazarus package is named FrameViewer09.lpk

Thank you for you giving me package name

In Lazarus 1.6.4 on Mac I get error

HtmlGlobals.pas(51.7) Error ENDIF without IF(N)DEF and then some more. (Also some with font name constants but that was easily solvable)

I will press on today - thank you

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: HtmlViewer
« Reply #7 on: November 19, 2017, 01:58:20 pm »
If I look at the readme then MACOS is not suppported (maybe yet)
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

MISV

  • Hero Member
  • *****
  • Posts: 792
Re: HtmlViewer
« Reply #8 on: November 20, 2017, 04:00:42 am »
For what it is worth - I got htmlviewer show pretty complex websites on Mac/Sierra Lazaus 1.6.4/Carbon combo tonight. There are a few problems (and seen a Sigsev as well) but my feeling is that it is immensely close at fully working. If the crash could be solved - I think it is a clear upgrade compared to old turbopower solution.

egsuh

  • Hero Member
  • *****
  • Posts: 1292
Re: HtmlViewer
« Reply #9 on: August 03, 2018, 04:57:20 am »
There were already discussion on this topic.  I'm running it on Win-64.
I got two errors during compilation.

First one is in the file vwPrint.pas, line 435.  DevModeA is unidentified, so I commented the line out.  Strange thing is that this is within conditional compilation, and the line is shadowed, but still there occurs error.

Code: Pascal  [Select][+][-]
  1. {$if lcl_fullversion >= 1020000}
  2.       // DevMode := PrnDev.DevModeA;
  3. {$else}

Second error occurs in file HTMLMisc.pas, at line 1259.  lbCarbon, lpQt, etc. are not identified. I used to comment this out, and hadn't any problem yet. But now I added LCLPlatformDef to uses clause, then it compiles fine  :D

Code: Pascal  [Select][+][-]
  1. initialization
  2.   htExpectsUTF8 := WidgetSet.LCLPlatform in [lpCarbon, lpQt, lpGTK2, lpWin32];
  3.   htExpectsUTF8 := True;


 

TinyPortal © 2005-2018