Have a big problem with the Header / Footer.
My print preview is working with three RichViewEdit (rich_header, rich_table and rich_footer) and in the preview of RVPrint1 it works well.
Well, the preview is not only print but also exported.
This edocengine I want to implement.
My Code:
procedure Thaupt_aufmass.PreparePrinting;
begin
if hauptpager.ActivePage = rechnung_daten then
begin
RVPrint1.AssignSource(rich_table2);
end;
if hauptpager.ActivePage = rechnung_rech then
begin
RVPrint1.AssignSource(rich_rech);
end;
if hauptpager.ActivePage = aufmass then
begin
RVPrint1.AssignSource(rich_aufmass);
end;
if not IsEmpty(rich_header) then begin
if StrToIntDef(txtHeader.Text,-1)<0 then
txtHeader.Text := '10';
RVPrint1.SetHeader(rich_header.RVData);
end
else
RVPrint1.SetHeader(nil);
if not IsEmpty(rich_footer) then begin
if StrToIntDef(txtFooter.Text,-1)<0 then
txtFooter.Text := '10';
RVPrint1.SetFooter(rich_footer.RVData)
end
else
RVPrint1.SetFooter(nil);
if hauptpager.ActivePage = aufmass then
begin
RVPrint1.LeftMarginMM := 6;
RVPrint1.RightMarginMM := 6;
RVPrint1.TopMarginMM := StrToIntDef(txtTop.Text,0);
RVPrint1.BottomMarginMM := StrToIntDef(txtBottom.Text,0);
RVPrint1.HeaderYMM := StrToIntDef(txtHeader.Text,-1);
RVPrint1.FooterYMM := StrToIntDef(txtFooter.Text,0);
RVPrint1.FormatPages(rvdoALL);
end
else begin
RVPrint1.LeftMarginMM := StrToIntDef(txtLeft.Text,0);
RVPrint1.RightMarginMM := StrToIntDef(txtRight.Text,0);
RVPrint1.TopMarginMM := StrToIntDef(txtTop.Text,0);
RVPrint1.BottomMarginMM := StrToIntDef(txtBottom.Text,0);
RVPrint1.HeaderYMM := StrToIntDef(txtHeader.Text,-1);
RVPrint1.FooterYMM := StrToIntDef(txtFooter.Text,0);
RVPrint1.FormatPages(rvdoALL);
end;
end;
My Call:
procedure Thaupt_aufmass.Rechnung2Click(Sender: TObject);
begin
hauptpager.ActivePage := rechnung_daten;
rich_header.Update;
rich_table2.Update;
rich_footer.Update;
printer.Orientation := poPortrait;
PreparePrinting;
// Specify output PDF filename
gtPDFEngine1.FileName := 'Output.pdf';
// Export the RVF file to PDF
gtRichViewInterface1.RenderDocument(RVPrint1,false);
end;
Header is very large display, the rest
works.
How should the code be if everything right to be exported?
With the TRVRTFReaderProperties.SetHeader I can not be right.
War may me a right code type?
Perhaps the manufacturers of TRichview soon as a quick and easy solution, users are waiting to turn.
Best Regards
Problem with headers and footers for export to PDF
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: