The problem was solved via a private mail from Julian. Thanks!
Beiträge von dybdahl
-
-
Thank you very much. However, my wPDF PLUS does not contain any .inc files or any DLLDCU directory. How do I solve that problem? I also don't have WPPDFR1 and WPPDFWP as part of wPDF PLUS.
-
I have wptools, and I asked Julian how to implement this procedure without making my exe file depend on an external DLL:
He said I should just buy wPDF PLUS, and that would solve my problem. I did that, but I cannot figure out how to implement this procedure. I promised my customer that I would do this, based on the information from Julian, so it is really important that I figure out how to do it.
Can anybody here tell me how?
-
As far as I can see, the correct way to save WPTools 5 report as PDF files, is to buy wPDF. Is there anyone here, that can tell me, if this works 100% smoothly, or if there are things that are not displayed correctly in some PDF viewers? If there are problems, what can I do with WPTools 5 as a workaround to avoid these problems?
I only use the API of WPTools 5, I don't use it as an editor.
Lars.
-
I have some RTF text that I want to insert into my document - how do I do this?
-
ASetColor with BGColor didn't work - but works well with FGColor. Problem solved ;-)
-
With BGColor I can only achieve black or white, not yellow... but I'll try FGColor today and I'll see how that works.
-
Sounds reasonable... FGColor to set a background color... why didn't I think of that? Hehe :-)
I guess it's because it's the foreground color of the pattern that is used to fill out the background...
Lars.
-
-
I have now tried almost all combinations of ways to apply a color to a table cell, but I only get black, white or grey cell backgrounds. How do I apply a blue background to a table cell?!?
Lars.
-
Hi Julian
In Microsoft Word, I can select the contents of a table cell, go into the Format/Paragraph menu, and set a check mark in the "keep with next paragraph" line. This will ensure, that there is no page break between that cell and the next row.
Why isn't that possible with WPTools? When I run the following code:
Then the checkmarks are not set when I view the report in Word.
Lars.
-
I have now had time to work on the problem, that my pictures weren't saved, and weren't present when I open my reports with Microsoft Word. I followed your instructions above, and ended up with this code:
Codepar:=rtf.ActiveText.AppendPar; par.align:=paralLeft; bit := TBitmap.Create; try wpobj := nil; try bit.LoadFromFile(extractfilepath(paramstr(0))+'graphics\reportlogo.bmp'); wpobj := TWPOImage.CreateImage(rtf.Memo.RTFData,bit); obj := TWPTextObj.Create; par.Insert(0, obj); obj.ObjRef := wpobj; obj.ObjType := wpobjImage; obj.Width := round(300*wpobj.ContentsWidth/wpobj.ContentsHeight); obj.Height := 300; except FreeAndNil(wpobj); end; finally FreeAndNil(bit); end;
This code doesn't work either - no bitmap is shown in Microsoft Word. I tried to define GRAPHICEX as you described, but then my project won't compile. In WPOBJ_Image it stops at:
Codeuses Classes, Sysutils, Forms, Windows, WPRTEDefs, Graphics{$IFDEF CLR}, Borland.Vcl.WinUtils, System.Runtime.InteropServices{$ENDIF}{$IFDEF GRAPHICEX}, GraphicEx{$ENDIF}{$IFDEF USEJPEG}, Jpeg{$ENDIF};
with the message:
Any ideas?
-
This seems to work decently:
Codepar:=rtf.HeaderFooter.Get(wpFooter,wpraOnAllPages).AppendPar(); par.align:=paralRight; obj:=rtf.HeaderFooter.TextObjects.InsertClass('', 0, 0, wpobjSingle,par); obj._SetObjType(wpobjTextObject); obj.Name:=WPTextFieldNames[wpoPageNumber];; obj.Source:=''; par.Insert(0,'Page ',txtplain); par.Insert(maxint,' of ',txtplain);
I'm still in doubt about how to use .InsertClass() in a way, that can place the page number at the end of the paragraph... and I still cannot figure out why wpoNumPages doesn't exist. Is that a WP Tools 4 feature, that wasn't ported to WP Tools 5?
-
I'm not sure that these input methods work in my case. Here is the code of my procedure:
Code
Alles anzeigenprocedure MyProc (rtf:TWPRichText); var table:TParagraph; txtplain,txtbold,txtboldbig: TWPCharAttr; par:TParagraph; begin FillChar(txtplain, SizeOf(txtplain), 0); FillChar(txtbold, SizeOf(txtbold), 0); FillChar(txtboldbig, SizeOf(txtboldbig), 0); rtf.ActiveText.RTFProps.AttrInterface.SetCharStyles (txtbold,WPSTY_BOLD,WPSTY_BOLD); rtf.ActiveText.RTFProps.AttrInterface.SetCharStyles (txtboldbig,WPSTY_BOLD,WPSTY_BOLD); rtf.ActiveText.RTFProps.AttrInterface.SetFontSize(txtboldbig,12); rtf.ActiveText.RTFProps.AttrInterface.SetFontSize(txtplain,9); rtf.Header.PageSize:=wp_DinA4; rtf.Header.Landscape:=true; rtf.Header.LeftMargin:=WPCentimeterToTwips(0.5); rtf.Header.RightMargin:=WPCentimeterToTwips(0.5); rtf.Header.TopMargin:=WPCentimeterToTwips(0.5); rtf.Header.BottomMargin:=WPCentimeterToTwips(0.5); par:=rtf.HeaderFooter.Get(wpFooter,wpraOnAllPages).AppendPar(); par.align:=paralRight; rtf.InputString('Page '); rtf.InputTextField(wpoPageNumber); rtf.InputString(' of ');
In this case, rtf.InputString() doesn't know that it should append to the TParagraph that was just created, and stored in par.
Also, the constant wpNumPages doesn't seem to appear in my system - I use WP Tools 5.0.
Lars.
-
Does anyone know how to make page numbers with WPTools, or is that impossible?
-
How do I insert page numbers by code (TParagraph etc.)?
Is it possible to make it "Page # of #"?
An example would be very nice!
Lars.
-
Hi Julian
Thanks for the tip - I'll try that.
Lars.
-
No ideas anyone? Julian?
Lars.
-
One of my report layouts consists of a table, where every third row is a kind of section header, and that row should be kept on the same page as the two next rows.
Is it possible to prevent pagebreaks between certain rows?
Lars.
-
Thanks for the explanation - I haven't had time to look at it, yet, but I will soon in order to have the image saved correctly.
Lars.