Beiträge von mgkrebbs

    It was noted in changes for 5.22 that there is an option to specify a style sheet.

    "-csspath:"..." can be used to specify a CSS style for loading and saving"

    I couldn't find an example of where this is done and what we should pass to it.

    Here is what I tried:

    FPaintEngine.Memo.TextLoadFormat:=FPaintEngine.Memo.TextLoadFormat+' -csspath:"\ReportStyleSheets\ReportStyles.css"';

    Do I need to send the full path, or will a relative path do?

    Do I need to add a link to it in a header in the html, or not?

    Thanks!

    Errors compiling WPTools 9 in Delphi7:

    Code
    [Hint] WPRTEPaint.pas(13122): Value assigned to 'dblbuffer' never used
    [Hint] WPObj_IMAGE.pas(1690): Variable 'ameta' is declared but never used in 'TWPOCustomImage.Paint'
    [Hint] WPObj_IMAGE.pas(1691): Variable 'ametacan' is declared but never used in 'TWPOCustomImage.Paint'
    [Warning] WPIO.pas(50): *** (Info) Reader and writer classes have been included using unit "WPIO"
    [Hint] WPRTEFormatBase.pas(204): Value assigned to 'tw' never used
    [Error] WPCTRMemo.pas(11586): Undeclared identifier: 'ssTouch'
    [Error] WPCTRMemo.pas(12158): Undeclared identifier: 'ssTouch'
    [Error] WPCTRMemo.pas(12452): Undeclared identifier: 'ssTouch'
    [Fatal Error] WPUtil.pas(74): Could not compile used unit 'WPCTRMemo.pas'

    the other references to "Touch" are inside {$IFDEF DELPHI_TOUCH} blocks.

    Should these lines be inside similar switches, or at least {$IFDEF DELPHIXE} +?

    I do have the {$DEFINE WPPDFEX} on in WPINC.INC , if it's related at all.

    Thanks!

    Julian,

    Delphi 7 update 2

    WP7Professional_v7.33.1

    wPDF4_PRO_InternetLicense_v4.77.2 (have {.$DEFINE INTWPSWITCH} off as instructed, so dll is not needed)

    ReportBuilder Enterprise Edition version 15.05 Build 275

    I think since I updated to WPTools 7 / I've not been getting hyperlinks when exporting reports to pdf (with wpdf, of course). The hyperlinks ar the right color and undelined, but do nothing in the pdf.

    I still have old exe's using WPTools 6 wpdf3, Report Builder 7.2, and the hyperlinks export just fine using those versions.

    Is there some compiler switch I need to change, or something I've forgotten?

    Thanks!

    Julian,

    I went with the wpview_pdfMakeImage function. Is there a good explanation of the "jpegres:Integer" parameter. I tried 100, thinking it was a percentage, and I had seen it in an example, but the image is about the same quality as before.

    This in your Instruction pdf, but it's over my head:

    Some example of low medium high would help me.

    Thanks.

    Julian,

    I wrote a pass-through function in ReportBuilder to render each page of a PDF and display in a ppImage. However the resulting image seems to lose some quality compared to what your demo app does with the image. And this is the raw image saved to file (2nd to last line). Any tips on getting 100% image quality?

    Thanks.

    Julian,
    In trying to get RequestHTTPImage event to fire for a TppWPTRichText (ReportBuilder), I came across this post:
    http://wpcubed.com/forum/viewtopi…t=createdynamic
    and read that it had to do with CreateDynamic. I didn't understand this bit:

    Zitat

    this event is actually triggered by the RTFDataCollection. You need to assign your handler there (w.RTFData) and not to the TWPRichText when you use a dynamically created editor control.

    Julian


    -so let me know the "proper" way to do this, but this is what I tried in my ppWPTools unit:

    Code
    //Result := TWPCustomRichTextForPP.CreateDynamic;
      Result := TWPCustomRichTextForPP.Create(nil);//2010-01-28 Dan 
      //Result._MakeDynamic;//2010-01-28 Dan 
      Result.InsertPointAttr.Hidden := TRUE;

    It did succeed in causing the RequestHTTPImage to fire, and I followed it in the debugger as it successfully loaded the jpeg image into the TextObject, however the image still just appears as a red box.

    Can you give me some guidance to help me get the image to appear?

    Thanks.
    D7
    WPTools 5_39
    WPTools RBSupport August 8, 2007

    My apologies, I thought I had sent the test html already, because, I did, but it was in the 10/3 email about the superscript/subscript tags. Sorry about that :oops:

    Here's the procedure, I added a part to add the -nospanobjects to the format. In the test project, I had to re-load it using stream to get the format to take effect (is there already a procedure to do this?), and it would not work unless the textloadformat is explicitly set to HTML to begin with (if 'AUTO' it wouldn't work), However in the ppWPTools unit, it does work, even when the format is 'AUTO'. Not sure why. I'm pasting the code, in case you have anny suggestions as far as improvements or best practices go:

    Code
    procedure TppCustomWPTRichText.WPToolsForceFont(WPRichText : TWPCustomRTFEdit; Size : Single; fName : String);var i : Integer;    ca : TWPCharAttr;    par : TParagraph;    sAddToFormat:String;    zStream:TMemoryStream;begin  sAddToFormat:='';  if (Pos('-nospanobjects',WPRichText.TextLoadFormat)=0) then    begin//add this to the load format, if not already there, then reload      if (Pos('-',WPRichText.TextLoadFormat)<>0) then        sAddToFormat:=sAddToFormat+',';      sAddToFormat:=sAddToFormat+'-nospanobjects';      zStream:=TMemoryStream.Create;      try        WPRichText.SaveToStream(zStream,WPRichText.TextLoadFormat);        zStream.Position:=0;        WPRichText.TextLoadFormat:=WPRichText.TextLoadFormat+sAddToFormat;        WPRichText.Clear;        WPRichText.LoadFromStream(zStream);      finally        zStream.Free;      end;    end;   WPRichText.RTFData.RTFProps.Attributes.EnumCharAttr(nil, CreateFontAndSize);   WPRichText.DefaultAttr.SetFontName(fName);   WPRichText.DefaultAttr.SetFontSize(Size);   par := WPRichText.RTFData.FirstPar;   while par<>nil do   begin      par.ADel(WPAT_CharFont);      par.ADel(WPAT_CharFontSize);      par := par.next;   end;   for i:=0 to WPRichText.ParStyles.Count-1 do   begin       WPRichText.ParStyles[i].TextStyle.ADel(WPAT_CharFont);       WPRichText.ParStyles[i].TextStyle.ADel(WPAT_CharFontSize);   end;   //WPRichText.ReformatAll(true, false);// Not required for HTML savingend;

    Here's where I call it in ppWPTools:

    Here's the results, I'm trying to force smaller font (8pt), and I'm still seeing some of it in larger type:

    Here's the html:

    In my first attempt at this I added my own options to the WPIOHTML unit, but the results were inconsistent. I abandoned that, and tried the approach of iteration through the paragraphs, but I think that method is really for RTF format, and not for HTML. How can I iterate through each tag in the HTML?

    Here's the code for the paragraphs, but I think b/c some paragraphs have several tags, some of the fonts get missed, still showing the larger font. (I'm trying to make them respect the font set in the ReportBuilder dialog properties of the TppDBWPTRichText so at the end of TppDBWPTRichText.LoadWPTRichText, I call:
    ...inherited LoadWPTRichText;
    WPToolsForceFont(Self.WPRichText,Self.Font.Size,Self.Font.Name);//2008-11-24
    end;

    Then, here's the procedure:


    To sum up, I want to do the same thing, but I want to do it tag-by-in the html, as opposed to par-by-par. Does that make sense?

    I collect info In HTML from end-users (online, so In a non-wpRichtext component in which I don't have control over font size), and I run a report using report Builder ppWPRichtext. For the report only, to save space ansnd have consistent format, I'd like to ignore the font size specified in the HTML. Is there a simple property setting I can set to ignore fontsize (whether done with style or otherwise), I do I need to loop through styles/attributes? Anyone have an example? Thanks.

    The distinction is lost on me. Shouldn't the mailmerge just replace the "Responsible_Person_Name" part, and not mess with the font part?

    I can programmatically set the font with Contents.MergeAttr.SetFontName('Arial') , but I want the font that the user intended, which I thought I could get with MergeAttr.GetFontName(x) before replacing the StringValue, but it's blank (event though the html before snippet shows it in there. Is the some Contents.Option that I need to have set differently?

    Upon reading the post, I need to disable the before/after HTML snippets:

    BEFORE Mailmerge:
    <mergefield name="Responsible_Person_Name"><font face="Arial" color="black">Responsible_Person_Name</font></mergefield>

    AFTER Mailmerge:
    <mergefield name="Responsible_Person_Name">Doright, Dudley</mergefield>

    Hi all,
    I'm using:
    Delphi 7
    WPTools 24.01.2007 V5.0 Release 22

    I add mailmerge fields using the TwpDefEditor, the only change I made is I set the DefaultIOFormat='HTML', when I mailmerge, I lose the font.

    HTML snippet BEFORE performing mailmerge:
    <mergefield><font>Responsible_Person_Name</font></mergefield>

    HTML snippet AFTER performing mailmerge:
    <mergefield>Doright, Dudley</mergefield>

    I've also tried doing the mailmerge two ways, with the OnGetMailMergeText event and using the TWPMMDataProvider component, with the same result.

    Am I neglecting to do something?

    OK, I ran the export procedures, on the differen machines, and Right after "PrintTo Devices" line, I save the TppReport component to a text file. The difference on that machine is that TppReport.PrinterSetup.PaperSize = 1 on the ones that render properly and TppReport.PrinterSetup.PaperSize = 0 on the one that has the "squished" ppWPDBRichText output. Does This property affect either wPDF or WPTools?