#1 2011-07-13 14:02:37

m@v
Member
From: Spořice, Czech republic
Registered: 2011-07-13
Posts: 2

AddFromRichEdit - font style not preserved

Hello.

I tried the synPDF and I must say it's wonderfull piece of code.

I tried it instead of PDF creator to save result of some electrical measurement. But I noted that the boldness (and possible other styles) from RTF aren't preserved. In the preview everything is OK, but in the resulting PDF there's everything from RichEdit without styling.

Manual output, using DrawText and other methods, where is the font.style property set manually, works fine. Maybe I'm doing something wrong, I tried include fonts in PDF and other things, but without effect. Only standard fonts and 'Symbol' font are used - the Symbol font seems not to be included too :-(

Part of the input file together with the whole testing source files and PDF output are stored on [http://web.spscv.cz/~kolousek/synPDF]

Thanks in advance for help of anyone here ...

  Tomas

Offline

#2 2011-07-13 14:55:24

reddwarf
Member
Registered: 2010-06-28
Posts: 40
Website

Re: AddFromRichEdit - font style not preserved

Hi, for RTF you need to draw it on a TMetafileCanvas and then you draw the metafile on the VCLCanvas. This creates the best results, i think.

There is some example code in this forum - you have just to search a little bit...

http://www.synopse.info/forum/viewtopic.php?id=76

Offline

#3 2011-07-13 17:46:25

m@v
Member
From: Spořice, Czech republic
Registered: 2011-07-13
Posts: 2

Re: AddFromRichEdit - font style not preserved

I was doing it in almost identical way as in the example you pointed me to - but I realized that when using in production code, which is utilizing TJVRichEdit from JVCL library, the font styles are retained as they should be. I'll investigate further what are the diferencies and how it is working when using TntRichEdit. I'm just wondering why the preview is displaying everything correctly and in the PDF output from TRichEdit source styles are missing.

I forgot to mention that it's related to Delphi7 which I'm using for my projects.

Regards

  Tomas

Offline

#4 2011-07-13 21:29:33

reddwarf
Member
Registered: 2010-06-28
Posts: 40
Website

Re: AddFromRichEdit - font style not preserved

that's interesting - I downloaded your demo program and it does exactly what it should - the correct formatting is preserved in the PDF - bold, alignment, underline, font size... (of course only in "Report PDF" Button, "Demo PDF" does not render the pdf text)...
everything works for me.

I use Delphi 2007
+ I am sorry to say that I have not Delphi 7 and so I can't check your code with it, but in Delphi 2007 the code works fine

Last edited by reddwarf (2011-07-14 05:53:12)

Offline

Board footer

Powered by FluxBB