table format in pixel changes to inches

  • Hello there,


    i use Delphi 10.2 and WPTools 9.1.820.

    I created a Table with WPRichText:


    <html>

    <head></head><body>

    <table cellpadding="0" cellspacing="0" style="margin:0.00in;padding:0.00in;width:100%;"><tr valign="top"><td valign="middle" style="vertical-align:middle;text-indent:0.00in;margin-left:0.00in;margin-right:0.00in;border-left-style:solid;border-left-width:0.01in;border-left-color:black;border-top-style:solid;border-top-width:0.01in;border-top-color:black;width:25%;"><span style="font-family:'Arial';font-size:17.00pt;">1. Spalte</span></td>

    <td valign="middle" style="vertical-align:middle;text-indent:0.00in;margin-left:0.00in;margin-right:0.00in;border-left-style:solid;border-left-width:0.01in;border-left-color:black;border-top-style:solid;border-top-width:0.01in;border-top-color:black;width:25%;"><span style="font-family:'Arial';font-size:17.00pt;">&nbsp;</span></td>

    <td valign="middle" style="vertical-align:middle;text-indent:0.00in;margin-left:0.00in;margin-right:0.00in;border-left-style:solid;border-left-width:0.01in;border-left-color:black;border-top-style:solid;border-top-width:0.01in;border-top-color:black;width:25%;"><span style="font-family:'Arial';font-size:17.00pt;">3. Spalte</span></td>

    <td valign="middle" style="vertical-align:middle;text-indent:0.00in;margin-left:0.00in;margin-right:0.00in;border-left-style:solid;border-left-width:0.01in;border-left-color:black;border-top-style:solid;border-top-width:0.01in;border-top-color:black;border-right-style:solid;border-right-width:0.01in;border-right-color:black;width:25%;"><span style="font-family:'Bell MT';font-size:17.00pt;">&nbsp;</span></td>

    </tr>

    <tr valign="top"><td valign="middle" style="vertical-align:middle;text-indent:0.00in;margin-left:0.00in;margin-right:0.00in;border-left-style:solid;border-left-width:0.01in;border-left-color:black;border-top-style:solid;border-top-width:0.01in;border-top-color:black;border-bottom-style:solid;border-bottom-width:0.01in;border-bottom-color:black;width:25%;"><span style="font-family:'Bell MT';font-size:17.00pt;">&nbsp;</span></td>

    <td valign="middle" style="vertical-align:middle;text-indent:0.00in;margin-left:0.00in;margin-right:0.00in;border-left-style:solid;border-left-width:0.01in;border-left-color:black;border-top-style:solid;border-top-width:0.01in;border-top-color:black;border-bottom-style:solid;border-bottom-width:0.01in;border-bottom-color:black;width:25%;"><span style="font-family:'Arial';font-size:17.00pt;">4. Reihe, 2. Spalte</span></td>

    <td valign="middle" style="vertical-align:middle;text-indent:0.00in;text-align:center;margin-left:0.00in;margin-right:0.00in;border-left-style:solid;border-left-width:0.01in;border-left-color:black;border-top-style:solid;border-top-width:0.01in;border-top-color:black;border-bottom-style:solid;border-bottom-width:0.01in;border-bottom-color:black;width:25%;"><span style="font-family:'Arial';font-size:17.00pt;">&nbsp;</span></td>

    <td valign="middle" style="vertical-align:middle;text-indent:0.00in;text-align:center;margin-left:0.00in;margin-right:0.00in;border-left-style:solid;border-left-width:0.01in;border-left-color:black;border-top-style:solid;border-top-width:0.01in;border-top-color:black;border-right-style:solid;border-right-width:0.01in;border-right-color:black;border-bottom-style:solid;border-bottom-width:0.01in;border-bottom-color:black;width:25%;"><span style="font-family:'Arial';font-size:17.00pt;">4.Reihe, 4.Spalte</span></td>

    </tr>

    </table>

    </body></html>



    I also created a Testproject with 2 Buttons and one Memo and one WPRichText.

    I added the HTML-Code of the Table into the Memo


    Once i load this to the WPRichtext-Component and load the content from the WPRichtext into the Memo again, the inches turn into px and from px into in etc.


    The Code for loading the Content from the Memo to the WPRichtext:

    WPRichText1.AsString:=memo1.lines.Text;


    The Code for loading the Content from the WPRichtext to the Memo:

    memo1.lines.text := WPRichText1.AsANSIString('HTML-onlybody');


    I already made another request - there i had to configure the WPIOHTML-unit.

    What do i have to add there to keep the format in pixels for example?


    Thanks in advance.

    Greetings

  • Hello,

    thank you for your reply.


    Is there no way to set a different format?

    Everytime i load the newly exported code back and export it again i receive either in or px by turns.

    for example:

    WPRichText1.AsString:=memo1.lines.Text; (text with same values but with px)

    memo1.lines.text := WPRichText1.AsANSIString('HTML-onlybody'); (memotext contains in)

    WPRichText1.AsString:=memo1.lines.Text; (text with same values but with in)

    memo1.lines.text := WPRichText1.AsANSIString('HTML-onlybody'); (memotext contains px)


    Thank you in advance.

    Greetings