diff options
-rw-r--r-- | extras/contributed/report_tool/demo/poppy-nb.jpg | bin | 0 -> 22609 bytes | |||
-rw-r--r-- | extras/contributed/report_tool/demo/poppy.jpg | bin | 0 -> 26709 bytes | |||
-rw-r--r-- | extras/contributed/report_tool/demo/radiobuttons.bmp | bin | 0 -> 2214 bytes | |||
-rw-r--r-- | extras/contributed/report_tool/demo/u_demo.pas | 24 | ||||
-rw-r--r-- | extras/contributed/report_tool/reportengine/u_pdf.pas | 25 | ||||
-rw-r--r-- | extras/contributed/report_tool/reportengine/u_report.pas | 8 |
6 files changed, 24 insertions, 33 deletions
diff --git a/extras/contributed/report_tool/demo/poppy-nb.jpg b/extras/contributed/report_tool/demo/poppy-nb.jpg Binary files differnew file mode 100644 index 00000000..e64db076 --- /dev/null +++ b/extras/contributed/report_tool/demo/poppy-nb.jpg diff --git a/extras/contributed/report_tool/demo/poppy.jpg b/extras/contributed/report_tool/demo/poppy.jpg Binary files differnew file mode 100644 index 00000000..367efe30 --- /dev/null +++ b/extras/contributed/report_tool/demo/poppy.jpg diff --git a/extras/contributed/report_tool/demo/radiobuttons.bmp b/extras/contributed/report_tool/demo/radiobuttons.bmp Binary files differnew file mode 100644 index 00000000..6523aa61 --- /dev/null +++ b/extras/contributed/report_tool/demo/radiobuttons.bmp diff --git a/extras/contributed/report_tool/demo/u_demo.pas b/extras/contributed/report_tool/demo/u_demo.pas index a9763ee1..390a2a60 100644 --- a/extras/contributed/report_tool/demo/u_demo.pas +++ b/extras/contributed/report_tool/demo/u_demo.pas @@ -104,7 +104,7 @@ type procedure PrintGrid(Preview: Boolean); procedure PrintGraph(Preview: Boolean); procedure PrintSurf(Preview: Boolean); - procedure PrintImag(Preview: Boolean); + procedure PrintImage(Preview: Boolean); public constructor Create(AOwner: TComponent); override; end; @@ -705,7 +705,7 @@ FReport:= T_Report.Create; with FReport do begin // Language:= Version; - PrintImag(False); + PrintImage(False); if T_Section(Sections[Pred(Sections.Count)]).TotPages= 0 then begin @@ -886,7 +886,7 @@ with FReport do begin //Language:= Version; DefaultFile:= 'Images.pdf'; - PrintImag(True); + PrintImage(True); Free; end; end; @@ -1510,7 +1510,7 @@ with FReport do end; end; -procedure TF_Demo.PrintImag(Preview: Boolean); +procedure TF_Demo.PrintImage(Preview: Boolean); var FtTitle,FtText: Integer; IlTitle,IlText: Integer; @@ -1531,15 +1531,13 @@ with FReport do // write page number and total of pages on each page NumPageFooter(cnRight,lnEnd,'Page','of',True,ColDefaut,FtText,IlText); // paint some images - //ImagePage(30,30,'poppy.jpg',4); - //ImagePage(40,50,'poppy.jpg',3); - //ImagePage(50,80,'poppy.jpg',2); - //ImagePage(60,140,'poppy.jpg'); - //ImagePage(100,30,'Unimesur_Logo.bmp'); - ImagePage(100,50,'ImageTest.bmp'); - //Page; - //ImagePage(80,30,'poppy-nb.jpg'); - //Page; + ImagePage(30,30,'poppy.jpg',4); + ImagePage(40,50,'poppy.jpg',3); + ImagePage(50,80,'poppy.jpg',2); + ImagePage(60,140,'poppy.jpg'); + ImagePage(100,30,'radiobuttons.bmp'); + Page; + ImagePage(80,30,'poppy-nb.jpg'); // preparation is finished, so create PDF objects EndWrite; end; diff --git a/extras/contributed/report_tool/reportengine/u_pdf.pas b/extras/contributed/report_tool/reportengine/u_pdf.pas index 6fe51d3e..b4e8415d 100644 --- a/extras/contributed/report_tool/reportengine/u_pdf.pas +++ b/extras/contributed/report_tool/reportengine/u_pdf.pas @@ -788,17 +788,6 @@ for CptH:= 0 to Pred(TfpgImage(Images[ANumber]).Height) do end; EndFlux:= AFlux.Position; Result:= EndFlux-BeginFlux; -//aflux.position:= beginflux; -//for CptH:= 0 to Pred(TfpgImage(Images[ANumber]).Height) do -// for CptW:= 0 to Pred(TfpgImage(Images[ANumber]).Width) do -// begin -// write(fpgGetRed(TfpgImage(Images[ANumber]).Colors[CptW,CptH]),' '); -// write(aflux.ReadByte,' - '); -// write(fpgGetGreen(TfpgImage(Images[ANumber]).Colors[CptW,CptH]),' '); -// write(aflux.ReadByte,' - '); -// write(fpgGetBlue(TfpgImage(Images[ANumber]).Colors[CptW,CptH]),' '); -// writeln(aflux.ReadByte); -// end; WriteChaine(CRLF,AFlux); WriteChaine('endstream',AFlux); end; @@ -1437,17 +1426,17 @@ Images.FObjet.AddElement('Type',Nom); Nom:= TPdfName.CreateName('Image'); Images.FObjet.AddElement('Subtype',Nom); // add width element to image dictionary -Nom:= TPdfName.CreateName(IntToStr(ImgWidth)); -Images.FObjet.AddElement('Width',Nom); +Long:= TPdfInteger.CreateInteger(ImgWidth); +Images.FObjet.AddElement('Width',Long); // add height element to image dictionary -Nom:= TPdfName.CreateName(IntToStr(ImgHeight)); -Images.FObjet.AddElement('Height',Nom); +Long:= TPdfInteger.CreateInteger(ImgHeight); +Images.FObjet.AddElement('Height',Long); // add color space element to image dictionary Nom:= TPdfName.CreateName('DeviceRGB'); Images.FObjet.AddElement('ColorSpace',Nom); // add bits per component element to image dictionary -Nom:= TPdfName.CreateName('8'); -Images.FObjet.AddElement('BitsPerComponent',Nom); +Long:= TPdfInteger.CreateInteger(8); +Images.FObjet.AddElement('BitsPerComponent',Long); // add name element to image dictionary Nom:= TPdfName.CreateName('I'+IntToStr(NumImg)); Images.FObjet.AddElement('Name',Nom); @@ -1589,7 +1578,7 @@ end; constructor TPdfDocument.CreateDocument; var - Cpt,CptSect,CptPage,NumFont,NumImg,TreeRoot,ParentPage,PageNum,NumPage: Integer; + Cpt,CptSect,CptPage,NumFont,{NumImg,}TreeRoot,ParentPage,PageNum,NumPage: Integer; OutlineRoot,ParentOutline,PageOutline,NextOutline,NextSect,NewPage,PrevOutline,PrevSect: Integer; Dictionaire: TPdfDictionary; XRefObjets: TPdfReference; diff --git a/extras/contributed/report_tool/reportengine/u_report.pas b/extras/contributed/report_tool/reportengine/u_report.pas index 84188fb6..20c8ac57 100644 --- a/extras/contributed/report_tool/reportengine/u_report.pas +++ b/extras/contributed/report_tool/reportengine/u_report.pas @@ -2217,7 +2217,7 @@ Borders.Free; if Images.Count> 0 then for Cpt:= 0 to Pred(Images.Count) do - T_Image(Images[Cpt]).Free; + TfpgImage(Images[Cpt]).Free; Images.Free; Texts.Free; VWriteLine.Free; @@ -2238,7 +2238,11 @@ then else if TPdfElement(PdfPage[Cpt]) is TPdfSurf then - TPdfSurf(PdfPage[Cpt]).Free; + TPdfSurf(PdfPage[Cpt]).Free + else + if TPdfElement(PdfPage[Cpt]) is TPdfImg + then + TPdfImg(PdfPage[Cpt]).Free; PdfPage.Free; DecimalSeparator:= OldSeparator; inherited; |