1
0
Files
aarre
applications
bindings
components
ZVDateTimeCtrls
aboutcomponent
acs
beepfp
chelper
cmdline
cmdlinecfg
colorpalette
csvdocument
epiktimer
fpsound
fpspreadsheet
fractions
freetypepascal
geckoport
gradcontrols
iosdesigner
iphonelazext
jujiboutils
jvcllaz
kcontrols
lazbarcodes
lclextensions
longtimer
manualdock
mplayer
multithreadprocs
nvidia-widgets
onguard
orpheus
playsoundpackage
poweredby
powerpdf
Example
ConsoleProgramDemo
DBExample
DBImage
FontDemo
JpegImageExample
JpegImageExample.dpr
JpegImageExample.res
Unit1.dfm
Unit1.pas
KylixDemo
LineDemo
MakeDoc
MultiSizePagesDemo
OpenActionExample
PageLayoutModeExample
ViewerPreferenceExample
BatchPdf.pdf
DBImage.pdf
DbExample.pdf
FontExample.pdf
JpegImageExample.pdf
LineExample.pdf
MultiSizePages.pdf
LazarusExamples
xpm
PRAnnotation.pas
PRJpegImage.pas
PReport.pas
PdfDoc.pas
PdfFonts.pas
PdfGBFonts.pas
PdfImages.pas
PdfJPFonts.pas
PdfJpCMap.pas
PdfJpegImage.pas
PdfTypes.pas
PowerPdf.dcr
PowerPdf.lrs
PowerPdf.pas
PowerPdfRef.pdf
lgpl.txt
pack_powerpdf.cfg
pack_powerpdf.dof
pack_powerpdf.dpk
pack_powerpdf.dsk
pack_powerpdf.lpk
pack_powerpdf.pas
pack_powerpdf.res
readme-lazarus.txt
readme.txt
rgbgraphics
richmemo
richview
rtfview
rx
scrolltext
smnetgradient
spktoolbar
svn
tdi
thtmlport
tparadoxdataset
tvplanit
virtualtreeview
virtualtreeview-new
xdev_toolkit
zlibar
examples
lclbindings
wst
lazarus-ccr/components/powerpdf/Example/JpegImageExample/Unit1.pas
jesusr 87fdff01a2 PowerPDF Check In
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@585 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2008-10-06 15:02:30 +00:00

91 lines
2.1 KiB
ObjectPascal

unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
PReport, ExtCtrls, StdCtrls, Buttons, PRJpegImage, ExtDlgs, PdfDoc, ShellApi;
type
TForm1 = class(TForm)
Panel1: TPanel;
ScrollBox1: TScrollBox;
PRPage1: TPRPage;
PRLayoutPanel1: TPRLayoutPanel;
PRJpegImage1: TPRJpegImage;
PRLayoutPanel2: TPRLayoutPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
CheckBox1: TCheckBox;
OpenPictureDialog1: TOpenPictureDialog;
PReport1: TPReport;
PRLabel1: TPRLabel;
SaveDialog1: TSaveDialog;
procedure CheckBox1Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure PRPage1PrintPage(Sender: TObject; ACanvas: TPRCanvas);
private
{ Private �錾 }
public
{ Public �錾 }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
PRJpegImage1.Stretch := CheckBox1.Checked;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
SaveDialog1.FileName := ChangeFileExt(ExtractFileName(OpenPictureDialog1.FileName), '.pdf');
if SaveDialog1.Execute then
with PReport1 do
begin
FileName := SaveDialog1.FileName;
BeginDoc;
Print(PRPage1);
EndDoc;
ShellExecute(Self.Handle, 'Open', PChar(FileName), '', '', SW_SHOW);
end;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
if OpenPictureDialog1.Execute then
begin
PRJpegImage1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
PRLabel1.Caption := OpenPictureDialog1.FileName;
PRJpegImage1.Repaint;
end;
end;
procedure TForm1.PRPage1PrintPage(Sender: TObject; ACanvas: TPRCanvas);
var
Dest: TPRDestination;
begin
// create a new destination for the current page.
Dest := PReport1.CreateDestination;
// setting the properties for the destination object.
with Dest do
begin
DestinationType := dtXYZ;
Left := -10;
Top := -10;
Zoom := 1;
end;
// set the destination object as the open-action.
PReport1.OpenAction := Dest;
end;
end.