Jump to content

Alexander Sviridenkov

Members
  • Content Count

    258
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by Alexander Sviridenkov


  1. Application is compiled with Delphi 11.1.

    I'm trying to connect to Firebird 3.0 on Linux, but getting error " [FireDAC][Phys][FB]-314. Cannot load vendor library ..."

    libfbclient,so (symbolic link) and libfbclient.so.3.0.10 are in the same directory as application. Even explicit setting of VendorLib with full path (tried both libfbclient,so and libfbclient.so.3.0.10) doesn't help.

    Libraries are from this archive: https://github.com/FirebirdSQL/firebird/releases/download/v3.0.10/Firebird-3.0.10.33601-0.amd64.tar.gz

    Interesting that when client library is replaced with one from Firebird 2.5 it is loaded succesfully, but 2.5 client cannot connect to 3.0 server.

     


  2. I'm glad to announce a new release of the HTML Office Library: 100% native and cross-platform Delphi library for conversion and displaying documents of the following types:

    • Rich Text Format (RTF)
    • MS Word 6-2007 binary format (DOC)
    • MS Word XML document (DOCX)
    • MS Power Point binary format (PPT)
    • MS Power Point XML format (PPTX)
    • MS Excel binary format (XLS)
    • MS Excel XML format (XLSX)
    • MS Excel XML binary format (XLSB)
    • Adobe PDF format (PDF)
    • Supercalc format (SXC)
    • EPUB (electronic books).
    • FB2 (electronic books).
    • Markdown.
    • Outlook Message (MSG)
    • MIME message (.EML)
    • Outlook databases (.OST, .PST)
    • The Bat! database (.TBB)
    • RAR archives
    • ZIP archives

     

    Whats's new

    1. Improved conversion quality for all document types.
    2. Significantly improved conversion speed and memory consumption for all document types.
    3. Reduced size of converted document for all document types.
    4. Document to text conversion is now much faster (direct text extraction and use of SAX parser for XML).
    5. Added support for MIME mail messages .EML (including attachments).
    6. Classes for reading Outlook databases (.PST, .OST).
    7. Classes for reading RAR archives.
    8. Classes for reading The Bat message folders (.TBB).
    9. New THtOfficeDocument.AsThumbnail function for creating document thumbnail.
    10. Added support for password protected office files (OnPasswordRequest callback in converion methods)
    11. New THtOfficeDocument.ConvertStreamtoText for converting to text with support for callback function which get
      next portion of text during conversion.
    12. New MaxLines and MaxPages properties to limit size of converted document.
    13. Converted Word/RTF documents can have paged and web layout.
    14. Direct PDF export for all platforms (no OS or third party library used).
    15. Fully functional text search engine  (can index documents from any souce: file, archive, database, etc. using implementation of IHtVirtualFolder interface).

     

    Conversion speed measurements:

    timing.thumb.png.e3a394479ce3f394ac1b595d820885e0.png

     

    There are two compiled demos available (source code of both applications is included):

     

    1. Simple document viewer: allows to view any document on hard drive using file tree on left side and HtPanel on right.
    https://delphihtmlcomponents.com/FileBrowser.zip

     

    2. Search Engine demo: create full text search index for documents located in selected folders and find any document from application or Web.
    https://delphihtmlcomponents.com/SearchEngine.zip
    This demo also shows the following features of THtSearchEngine:

     

    Date map - found document number by year

    DateMap.thumb.png.879415d46978db6fb3bf7a52ea8cb9c8.png

     

    Type Map - found documents by category

    1011681315_Screenshot2022-06-29at18-41-57HTMLOfficeLibraryDemo.png.d5c9a2bb1b0f2520990e073f18d9daef.png

     

    Completion

    completion.thumb.png.7c19fae9f585ecbbafae027955c283c9.png

     

     

    Test on sample database:

     

    image.thumb.png.2cc228fbda5ec62e3670c0cb8e826617.png

     

    Note that search time depends only on amout of found/shown documents  and do not depend on total document count.

     

    https://delphihtmlcomponents.com/office.html

     

     

    • Like 5

  3. I'm glad to inform you about a new release of the HTML Library.

    It is used by thousands of developers from 50 countries, and now even the RAD Studio IDE. From version 11.2 library will be used by the IDE to render rich text.

     

    What's new in version 4.6:

     

    Core

    1. Packages names are now the same for all IDE versions (starting from Delphi 11).
    2. Faster parsing and style calculation
    3. SAX XML parser class with special text extration mode.
    4. THtLabel now allows text change in click events.
    5. CSS serialization (modified CSS StyleSheet can be saved back)
    6. Direct PDF export on all platforms including Linux (when using Office library)
    7. Document sections (custom header, footer, page size and orientation for each section).
    8. Support for different page sizes in print preview (each page can have own size)
    9. System theme colors support (Windows, OSX), f.e. background: window) with ability to use custom theme color callback.
    10. Converting HTML to paged payout SVG (print preview can be viewed from browser)
    11. Zoom from Cursor mode in HtPanel/Editor.
    12. New TElement.InsertHTML method.
    13. CSS outline propety support.
    14. CSS focus-within pseudoclass support.
    15. CSS marker pseudoclass support.
    16. CSS list-style-position property.
    17. Added w-resize and h-resize for CSS cursor.
    18. THtDocument now can be used from threads (Special parameter in constructor for use separate font collection).
    19. Workaround for FMX bug: rectangle and rounded rectangle with large pen width incorrectly drawn on Android.
    20. New HtPanel properties: MinScale, MaxScale

     

    Editor

    1. Support for style attribute inside MathML elements.
    2. New editor option: eoDisableBlockJoinOnPaste - do not join pasted blocks with current
    3. New editor option: eoPasteTextBlockAsPara - convert text blocks divided by blank lines to para.
    4. eoClearPastedFormatting now removes span elements wuthout attributes.
    5. New editor method: PasteTextfromClipboard - paste plain text only.

     

    Reports and Scripts

    1. Chart now supports style attribute in chart element.
    2. Reports library now supports Lazarus (including print preview)
    3. Scripter: support for calling chained indexed properties, f.e. Obj[k].

     

      https://delphihtmlcomponents.com

     

    • Like 9
    • Thanks 1

  4. 10 minutes ago, Darian Miller said:
    
    <body><div id="1"><h2 id="h1"> text1 <ul><a href="a1">First</a><a href="a2">Second</a></ul></div><div><h2 id="h2"> text2 <ul><a href="a3:>Third</a></ul></div></body>

    I could not get chaining to work.  On a basic example, I'd want a list of anchors for h1 and another list of anchors for h2 within a much more complex source.  I tried retrieving the header by id and searching for anchors under and I didn't get any results.  After a short time, I switched to another suggested solution (htmlparser) but ended up moving on to something else.

     

     

    Sorry, I forgot to mention that when using chaining, current node should be passed to XPath as parameter to prevent XPath walking up toi root.

     

    var D: THtmlNode;
        N, A: THtNode;
    begin
      D := THtmlNode.Create;
      try
        D.Parse('<body><h1 id="header1"<a href="a1">First</a><a href="a2">Second</a></h1><h2><div><a href="a3">Third</a></div></h2></body>');
        for N in D.XPath('//h1[@id="header1"]') do
          for A in N.XPath('//a', false, N)  do
           ShowMessage(A['href']);
        for N in D.XPath('//h2') do
          for A in N.XPath('//a', false, N)  do
           ShowMessage(A['href']);
      finally
        D.Free
      end;

    Second parameter is "stop after first found node", third is current root node.

    • Thanks 1

  5. 13 minutes ago, Darian Miller said:

    Note: the example code you provided fails as a canvas was not specified.

    Only when using THtDocument. With THtmlNode and THtmlStyledNode works without canvas units

     

    uses htmlpars;
    
    var D: THtmlNode;
        N: THtNode;
    begin
      D := THtmlNode.Create;
      try
        D.Parse('<body><div id="1"><ul><a href="a1">First</a><a href="a2">Second</a></ul></div><div><ul><a href="a3">Third</a></ul></div></body>');
        for N in D.XPath('//div[@id="1"]/ul/a') do
          ShowMessage(N['href']);
      finally
        D.Free
      end;

     


  6. 54 minutes ago, Vincent Parrett said:

    ^ This. I looked at using the parser in a console application but the requirement for a canvas etc brings in the vcl makes it a non starter (can't use the vcl at all under docker). I've had this issue with several well known third party libraries - the lack of layering and tight coupling with the vcl in libraries really reduces their possible uses. 

    HCL is layered, HTML and CSS parsers has no dependencies on framework or OS.  Class hierarchy is

    THtNode (htmlpars unit, only RTL)  -> THtXMLNode (htxml unit, only RTL)

          |

    THtmlNode (htmlpars unit, only RTL)

          |

    TStyledHTMLNode (htmlcss unit, only RTL)

          |

    TElement (htmldraw unit)

          |

    THtDocument (htmldraw unit)

     

    THtDocument/TElement use VCL/FMX units for several reasons

    1. Native controls in HTML page (edits, combos,  etc.) .

    2. VCL themes (theme colors support)

    3. VCL/FMX canvas (THtDocument can draw on VCL/FMX canvas)

     

    But all graphics (canvas classes) is isolated.

    • Like 2

  7. 4 hours ago, Darian Miller said:

    Feature requests - allow parser usage without specifying a canvas.  Also allow XPath from a particular node or chain multiple XPath statements together...currently having trouble filtering an already filtered input.  In some sample HTML docs, there are Header elements that separate nearly identical lists of values with a handful of items before/after the lists. The headers have IDs so I'd like to select the list after the header.  Perhaps it's because an XPath noob but it seems easiest to simply iterate all elements and find the header I'm interested in and grab data until the next header shows up in a state machine.

     

     

    Parser itself do not depend on canvas, VCL or something else. You can use THtmlNode class (hmlpars unit, code is almost the same: D := THtmlNode.Create;D.Parse(..))

    THtmlNode supports XPath. For JQuery please use TStyledHTMLNode (htmlcss unit).

    Both XPath and JQuery can be called from any node so chaining is possible.

     


  8. Sample

    uses htmldraw, htmlpars;
    ..
    
    var D: THtDocument;
        N: THtNode;
    begin
      D := THtDocument.Create;
      try
        D.Parse('<body><div id="1"><ul><a href="a1">First</a><a href="a2">Second</a></ul></div><div><ul><a href="a3:>Third</a></ul></div></body>');
    
        for N in D.JQuery('div#1 ul a') do
          ShowMessage(N['href']);
    
        for N in D.XPath('//div[@id="1"]/ul/a') do
          ShowMessage(N['href']);
    
      finally
        D.Free
      end;

     

    • Like 2
    • Thanks 1

  9. 20 minutes ago, David Schwartz said:

    What is HCL? Is there a button or graphic that I can display things on and format the BG color, Font attributes, display text, some smileys, etc?

    HTML Component Library. Yes, it can display almost the same as browser (HTML4 and CSS3, except JS) but I was thinking about using its CSS part for calculating and applying rules.

×