Jump to content

Edwin Yip

Members
  • Content Count

    430
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Edwin Yip


  1. Hi all,

     

    I've just encountered an issue that's quite strange and it took me hours to figure out but still couldn't confirm where dose it come from.

     

    The situation I found is like this:

    Let's say we have a VCL program with DPI-aware enabled (with xml manifest correctly set, all forms have `Scaled` set to true and working), and the form inheritance is like this:

    TFormC inherits from TFormB which in turn inherits from TFormA, which have some buttons on some panels.

     

    I found that, when running on a computer with different system DPI, TFormA will be auto scaled for 1 time and it's correct.

    But TFormB will be wrongly scaled and shifted twice, while TFormC will be scaled and shifted for 3 times.

     

    All other forms, even with form inheritance, but since there is no controls on the parent forms, the auto-scaling works.

     

    I'm not sure if it's related to my Delphi version and I use XE4, I wonder anyone can confirm if the issue comes from form inheritance? 


  2. With my very limited knowledge in this area (in the information collecting stage for a possible future project), ActiveX solutions aside, AFAIK, there is only one free option - use the low-level API of PdfiumLib, but I'm not sure if there is any Delphi sample code.

     

    If you can wait, ImageEn developer is planning to add such annotation feature to that lib (with has a PDF viewer already).


  3. 1 hour ago, Alexander Sviridenkov said:

    There is CSS contenteditable property which can be set to true or false using snandard CSS rules.

    Great!

     

    Quote

    Deleting of certain tags cannot be prohibited, but editor supports XML schema which can define rules for adding new tags (what tags are allowed and what tag can be added to another tag).

    Pity. Can't the editor provide events like `OnBeforeDeleteElement`, `OnBeforeEditElement`, and so on?


  4. @darnocian, according to the documents, since custom function for the template must be defined as static class methods, how do I access contextual data in those utility methods?

     

    I can see you can use `class var` to pass contextual data to the utility class before calling `Template.Eval`, but in case of multi-threaded template rendering, it seems that locking is unnecessarily needed. But at least it's workable? I'll try but you might have a better answer? Thanks.

     

    It'll be great if ITemplateFunctions.AddFunctions supports non-class methods, so that in the methods the object's fields are accessible.


  5. 16 minutes ago, darnocian said:

    Yes, you can do something like the following:

    
    begin
      var ctx := Template.Context;
      ctx.StartToken := '{{';
      ctx.EndToken := '}}';
      Assert.IsEqual('hello', Template.Eval(ctx, '{{ if true }}hello{{else}}bye{{end}}'));
    end;

     

    Oh, I think you misunderstood - what I mean is that you can customize the html code generated by `RenderMenu` by allowing the passing to it the `<li>` tags to use, for example, use `<li class="levelItem">`


  6. 1 hour ago, Xequte said:

    Editing of annotations via PDFium is on the to-do list.

    This is a great news!!!!

     

    Quote

    If you are looking to generate PDF files only (i.e. not edit existing PDF files) then ImageEn's native PDF support (creating and saving) can be used in threads.

    Can you point us to the specific page on your site that describes this feature in detail? Thanks.

     


  7. 26 minutes ago, timfrost said:

    But anything based on PDFIUM has the limitation of single threading only. Which may not matter if you have a user interactively tweaking annotations and images, but it does to the applications I deal with.

    I don't know that limit. Do you mean you cannot manipulate the pdf with Pdfium in a background thread even using a legitimate locking mechanism? 


  8. Congrats for the new release. I've got several questions if you don't mind:

    • Is the pdf engine based on Pdfium?
    • Can you add pdf annotation such as text, rectangle, and so on to a pdf and save to disk, like you can do with image files with ImageEn?
    • Does it support navigating a pdf file with the hierarchical bookmarks like this: https://www.winsoft.sk/pdfium.png

    Thanks.

×