Jump to content

Alexander Sviridenkov

Members
  • Content Count

    258
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by Alexander Sviridenkov


  1. Whats's new

    1. Improved performance for all document types.
    2. Special TextMode mode for fast extracting of text content.
    3. Outlook message format support (.MSG)
    4. Markdown format support (.MD).
    5. New RTF document parser.
    6. HTML to DOCX conversion (basic implementation).
    7. Improved EMF and WMF to SVG conversion.
    8. Creation amd modification of DOCX files.
    9. Text bit index classes for fast document search/indexing.
    10. OpenType font class now supports creating text layouts, applying OpentType features and text measurement.
    11. Improved font glyph to SVG conversion.
    12. Support for XLSB format.
    13. Support for old Delphi versions (from Delphi 7).
    14. Support for mobile platforms.
    15. Delphi 11 Alexandria support.

     

    What is Office Library: native cross-platform Delphi library for converting all MS Office formats to HTML and displaying it in your application or browser.

    No external dependencies, support for all Delphi versions from Delphi 7, native classes for work with OpenType fonts, special classes for creating  full text search document indexes.

    Supported formats:

     

    • 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).
    • Markdown.
    • Outlook Message (MSG)

     

    More details: https://delphihtmlcomponents.com/office.html

     

    Compiled demo applications (documentation is included):

     

    https://delphihtmlcomponents.com/FileBrowser.zip

    https://delphihtmlcomponents.com/FontBrowser.zip

     

     

     

     

    30% discount on Office Library Site License is available until end of September. Please use coupon code OFFICE2021


  2. Yes, font class can read and write TTF and WOFF, and also extract font of any format from PDF (CFF, PostScript, etc) and convert it to TTF (not simply wrap as CFF but convert outlines). Visual glyph editing can also be easily implemented using SVG.

    Please check http://delphihtmlcomponents.com/FontBrowser.zip compiled demo, it shows all capabilities - read, write, extract, and contains visual glyph editor (simple HtPanel). Only around 100 lines of code.

    BTW, font class can import glyphs from SVG path.

     

    This is part of Office library.

     


  3. Just made this for fun. Canvas for HTML library which uses no system text/font API. Everything is processed inside library.
    Fonts are loaded directly from TTF file/stream. Strings are converted into sequence of glyphs and transformed by various opentype features (kerming, glyph substitution/reposition, RTL, ligatures, etc.).
    After that glyphs are converted to graphics paths and rendered using D2D FillGeometry method.
     
    • Like 7

  4. HTML Component Library, HTML Editor Library and HTML Report Library version 4.5 released.

    What's new:

    1. RAD Studio 11 Alexandria support.
    2. New THtMarkdownPanel component for displaying Markdown documents.
    3. Improved Markdown support (tables, links, etc.)
    4. Improved rending or large SVG images
    5. Improved Flex support.
    6. Improved handling of incorrect markup (tag order).
    7. Added THtPanel.OnShowResizeHint event.
    8. Added THtDocument.EmbedAllImages method for embedding images into document.
    9. Added THtPanel.Script property for storing common scripts.
    10. Added PrintScale parameter to Print method for scaling pages.
    11. Added SplitBlocktoRoot method for splitting nested blocks (f.e. citation in emails).
    12. Support for disablet attribute in inputs.
    13. Added HighlightCheckedNodes property in THtVirtualXMLTree.
    14. Improved scrolling of page with many input controls.
    15. Added PNG encoding of pasted images for FMX.
    16. New Editor event OnSurrogatePair. This event is called on second (low surrogate) char and when it returns true, default char processing is skipped.
    17. SVG: added support for preserveAspectRatio with values none, meet and slice.
    18. Faster rendering of large break-all blocks.
    19. Support for type="number" in inputs.
    20. Added Remove method to JQuery.
    21. Addes support for attr!=value selector
    22. Added support for summary and details elements.
    23. DOCX to HTML conversion is now supported in Delphi 5 - 7.

     

    Fixed issues: https://delphihtmlcomponents.com/fixed45.html

     

    https://delphihtmlcomponents.com/

     

    • Like 8
    • Thanks 1

  5. New compiled demo showing font management capabilities of HTML Office Library. it can:
    Open TTF or WOFF font.
    Extract embedded fonts of any type from PDF file.
    Save extracted font as TTF or WOFF.
    Show font glyphs.
    Show glyph control points.
    Copy glyph as SVG.
     
    100 lines of Delphi code. Everything is cross platform (Win, Mac, Linux, iOS, Android)
     
    https://delphihtmlcomponents.com/FontBrowser.zip
     

    fontexplorer.gif

    • Like 7

  6. This is my fault, code for image should be

     

     <img style="position:fixed;top:-100%; left:0px;" src="_INCLUDED_VIA_LINK_Briefbogen_Demo_Full.png" width="210mm" height="297mm"/>
     

     <img style="position:fixed;top:-100%; left:0px;" src="_INCLUDED_VIA_LINK_Briefbogen_Demo_Full.png" width="210mm" height="297mm"/>
     

    because 100vh is calculated from inner page size. Using this code image covers page exactly.

    flexbox is supported in 4.4, but for paged media tables have better support (spliting across pages).

     


  7. As I wrote previously, this can be solved by image in page header (position: running(heading)). Please use the following HTML:

     

    <!DOCTYPE html>
    <html>
    <style>
    .page {page-break-before: always}
    @page {size: A4 portrait; margin: 0px}
    </style>
    <body>
    
      ...document content...
    
      <div style="position: running(heading);height:70px">
        <img style="position:fixed;top:-100%; left:0px;" src="_INCLUDED_VIA_LINK_Briefbogen_Demo_Full.png" width="100vw" height="100vh"/>
      </div>
    
    </body>
    </html>
    
    	

    Result:

     

    acme.png

    • Like 1

  8. Header and footer should be defined manually, library supports CSS position: running(heading/footer)

     

    Quote

    Page header and footer can be defined using any block element and CSS style position: running(heading/footer). Example:

    <style>
    footer {position: running(footer); text-align: center; border-top: solid #aaa 1px; text-align: center; font-size: 9pt; left: 5%; width: 90%; height: 36px }
    .pagecount:before {content: counter(pagecount)}
    </style>

    <footer>Page <span class="page"></span>/<span class="pagecount"></span></footer>

    This sample also contains page number and page count which are defined using content property.
    Footer size is calculated automatically from page footer block height.

    Document can contain several headers/footers. CSS property page is used for  selecting  on which page header/footer will be displayed.
     page can have following values:

     last: only last lage
     last-: all pages before last
     odd: odd pages
     even: even pages
    <number> (1,2,..): only <number> page  
    <number+> all pages after <number>

    To set page margins use CSS style:

    @page {margin: 0px 0px 0px 0px}

    Page background can be defined by image in header with fixed position and 100% width/height.

    To split document to pages add CSS page-break-before/after: always to any element.

    Finally call THtDocument.HTMLtoPDF

     

    Quote

    PDF export is available on all platforms, but on Windows it requires free SynPDF library. Please download this library, add its path into IDE library path list, uncomment
    {$DEFINE SYNPDF} in htmlinc.inc and add htsynpdf unit into uses list.

    To export into PDF without creating THtDocument use the following class methods of THtDocument:

        class function HTMLtoPDF(const AHTML: hstring; const AStyles: hstring = ''): TBytes;
        class procedure HTMLtoPDFFile(const AHTML, FileName: string);

    Normal THtDocument created for displaying cannot be used for PDF export. Create separate THtDocument using CanvasClass.PrintCanvasClass, prepare paged layout and then use Surface.G.SavetoPDFFile/SavetoPDFStream methods.
    Example:

    var 😧 THtDocument;
    begin
      {$IFDEF FMX}
      D := THtDocument.Create(HtFMXDefaultCanvasClass.PrintCanvasClass);
      {$ELSE}
      D := THtDocument.Create(HtDefaultCanvasClass.PrintCanvasClass);
      {$ENDIF}
      try
        D.Parse(AHTML);
        D.GeneratePagesForPrint;
        D.Surface.G.SavetoPDF(FileName);
      finally
        D.Free
      end;

     

     


  9. 15 minutes ago, Mike Torrettinni said:

    Yes, it's very powerful component, shame it can't parse expressions that are not pure SQL. I could probably customize my expression to add 'SELECT' and other sql keywords to parse, but that is not what I'm after.

     

     

    It can. Just override GetDialect method (uses sqlparse)

     

    type
      TCustomExpression = class(TSQLExpression)
      private
        FDialect: TSQLDialect;
      public
        function GetDialect: TSQLDialect; override;
        destructor Destroy; override;
      end;
    
    destructor TCustomExpression.Destroy;
    begin
      FDialect.Free;
      inherited;
    end;
    
    function TCustomExpression.GetDialect: TSQLDialect;
    begin
      if  FDialect = nil then
        FDialect := TSQLDialect.Create;
      Result := FDialect;
    end;
    
    procedure TForm67.Button1Click(Sender: TObject);
    var SE: TCustomExpression;
    begin
      SE := TCustomExpression.Create(nil);
      SE.ParseString('user=''john'' or user = ''peter''');
      ShowMessage(SE.Node.Children[0].Children[1].Name); //=john
    end;

     

    Also there is pascal expression class in htscriptparse unit:

     

    var SE: TScriptExpression;
    begin
      SE := TScriptExpression.CreateAndParse('(user=''john'') or (user = ''peter'')');
      SE.Variables['user'] := 'peter';
      ShowMessage(SE.Calc)

     

    • Thanks 1

  10. Usually schema changing occurs rarely enough  (much less frequently that typing in query editor) so reloading changed part right after change should not affect performance.


  11. >>This is exactly what I would like to do. Very nice! Are you parsing the whole SQL text with each keypress?

     

    Yes, but it works very fast.


    >>In my project the database schema is "loaded on demand" in a background thread. Queries/Scripts/Batchmove runs in that background thread. And I store the metadata also in that thread. That's why I need to get call the completion form when receiving the message.

     

    But taking into account that schema is loaded only once, is there reason to fill autocomplete asynchronously? You can start background loading when necessary and fill autocomplete only if schema is already loaded.


  12. 27 minutes ago, Kas Ob. said:

    the most comprehensive SQL parser for pascal is the one by NexusDB, there is one file called nxSQLParse.pas and it is freaking scary !

    HTML Library Bundle contains SQL framework with SQL parser for Firebird, Oracle, MySQL, Postgres, Microsof SQL, Elevate and SQLite. Library supports query parsing, formatting, translation between SQL dialects, modifying (change order, where, limit, fields, etc) syntax check and DB schema check, editor completion implementation and much more. https://delphihtmlcomponents.com/SQLLibrary.pdf

    • Like 1
×