Beiträge von Fuscus

    We use WPTools5 extensively in our applications. For the most part it is very good, excellent in fact, but of course occasionally we have a foible to contend with. This is one.
    Our application occasionally saves user generated HTML to a PDF file. We have partial control of the resulting format. This works well until a bold Lucida Console segment is called.


    the problem is that <b>test</b> is rendered into a strange font smaller than the non-bold font. It looks like the font has been compressed vertically.

    I can send you the output PDFs if desired.

    Anyhow a workaround seems to be to remove "Lucida Console" from the CSS and replace it with Consolas.

    As this may affect a lot of applications we would prefere not to change the font

    We have a large project that may import documents using TWPWordConverter. We also use DUNIT tests but noticed behavioral differences between the DUnit tests and the "real" methods. Basically the DUNIT tests would popup a dialog with the message "microsoft word 97 conversion. Unable to convert graphic"!
    It took a long while but I finally figured out the difference, the DUNIT tests used relative file paths while the application used absolute paths. Using relative paths would cause the TWPWordConverter to use the word 97 convertor instead of the curent word convertor for unknown reasons.

    DUNIT
    filename = '..\projects\dunittest\testdata\RTF_FailedFiles\HeaderProblem.doc'
    convertor used = 'C:\Program Files\Common Files\Microsoft Shared\TextConv\mswrd832.cnv'

    Project
    filename = 'M:\code\medicalobjects_head\projects\dunittest\testdata\RTF_FailedFiles\HeaderProblem.doc'
    convertor used = 'C:\Program Files\Microsoft Office\Office12\Wordcnvpxy.cnv'

    I hope this helps someone avoid the problems I encountered
    Whoops - this should have gone into the version5 forum

    Zitat von wpsupport


    If you want transparent images You can use PNGs.


    User is allowed to select images and gifs ( and jpgs and png)are in the breif

    Zitat von wpsupport

    ..
    You solution to update the gif is interesting.


    Quick and dirty would be a better description. :)

    Zitat von wpsupport


    I would have suggested to paint the GIF transparently on a bitmap and reassign.
    Julian


    I'll give that a try.

    OK got the Transparency issue fixed however the solution is not the most elegent but at least I'll get to feed the kids this week.

    OK got the saving issuse sorted

    and the save is RtfText.AsANSIString('Rtf-AlwaysEmbed,-nobinary,'); (note the commas).
    But the gif images are no longer transparent.
    Looks like another challage awaits

    Oh - and the image was inserted thus

    In Wp 5 I'm attempting to save a header that contains a GIF as RTF
    The command I use is as follows

    Code
    Result := WP.HeaderFooter.Get(wpHeader, wpraOnAllPages).RtfText.AsANSIString('Rtf-AlwaysEmbed');

    However I get back the RTF with what appears as a tuncated version of the file

    Zitat

    Header RTF = '{\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset1 AvantGarde Bk BT;}{\f2\fnil\fcharset1 Wingdings;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\wpprheadfoot1\paperw12240\paperh15840\margl1880\margr1880\margt1440\margb1440\headery100\footery100\ftnbj\sftnbj\sftnrstcont\nocolbal\sftnnar\saftnnar\fet0\endnhere\sectdefaultcl{\*\generator WPTools_5.370-PRM;}{\tblstart1{\trowd\trleft-1417\trftsWidth2\trwWidth5000\clftsWidth2\clwWidth2500\clvertalt\cellx4223\clftsWidth2\clwWidth5000\clvertalt\cellx9863\pard\intbl\itap1\li0\fi0\ri0\sb0\sa0\ql\plain\fs22{\*\wptools\wpomode0\wpoframe0{110e0a005457504f626a6563740054504630095457504f626a656374000757696474685457039b0a08486569676874545703ae060c57726974655254464d6f6465070c776f624175746f6d61746963064f626a546167020000003f3f3f00}}\cell\pard\intbl\itap1\li0\fi0\ri0\sb0\sa0\qr\plain\f1\fs28\b{\field{\*\fldinst{MERGEFIELD ZFD|SIMPLE^^L|sSTF|dtHL7ST|Practice_Address.OtherDesignation}}{\fldrslt{Practice Name}}}\cell\row}\tblend1\pard\plain\li-1417\ri-1417\par
    }}'

    An attempt to reopen the file gives me only the place holder . I've compiled the code with GIFIMG.
    If I do the same with a BMP file then every thing is hunky dory.

    Any suggestions
    Thanks in advance

    Thanks for your reply.
    I had manged to work it out on my own about an hour before your post using WPAT_BoxMarginLeft and turning of the max box width. But your suggesttion has made the code alot neater

    [/quote]

    Hi all,
    My client wants headers and footers to have a a different margin from the body. I am able to do it using input text but the input is not plain text, it will contain merge fields and are stored as HTML (See sample Input). The code workes perfectly if I enter in a plain string but entering in HTML it will indent the first <Div> but not subsequent <div>s. What happens is that the reader divides the HTML up into paragraphs and only indents the first as can be plainly seen in the sample output ( Note : input was cTestText for the header and cTestHTML for the footer). In particular look at line 4 of the rtf output and notice the indents have been reset.
    How do I make the indent continue thoughout the header/footer?

    Thanks in advance

    sample Input


    Delphi Code IndentedHeaderFooter

    SAMPLE OUTPUT (RTF)