#1 Re: PDF Engine » Casting TPdfDocumentGDI VCLCanvas/TCanvas » 2015-07-07 11:42:05

Hello

the getPdfOpject is...

procedure TfaStartf.createPdfObject;
begin
m_tpdf:=TPdfDocumentGDI.Create

end;
{------------------------------------------------}

function TfaStartf.getPdfObject:TPdfDocumentGDI;
begin
result:=m_tpdf
end;

#2 PDF Engine » Casting TPdfDocumentGDI VCLCanvas/TCanvas » 2015-07-07 11:19:48

loris
Replies: 3

Hello

MyProcedure has this paramters

destination: TCanvas;AusgabeNummer:Integer;ppdf:Boolean = false);

so, when ppdf is true then
I set destination to VCLCanvas.

My idea was something like this:

if ppdf then
destination :=getPdfObject.VCLCanvas;

Unfortunately it will be throw an access error.

Could someone help me?

Thanks,

loris

#3 Re: PDF Engine » PrinterCanvas to SynPdf » 2014-03-07 14:00:32

Thanks for fast answer

Now I reveive a pdf, empty unfortunately.

The parameter of dosome(...) is TCanvas -->procedure printPDF(destination: tcanvas;outputnr:Integer);
dosome(lPdf.VCLCanvas);

lPdf.SaveToFile('c:\hallo.pdf');
      lpdf.Free;

Do you thinks there must happen something in the code, or...

Regards, merci bc

#4 Re: PDF Engine » PrinterCanvas to SynPdf » 2014-03-07 11:34:21

Thanks for the answer,
I made I interface with TCanvas, but how can I set canv
to PDFCanvas? Its necessary that I use tcanvas.

var
lPdf : TPdfDocumentGDI;
canv:TCanvas;
begin
lPdf := TPdfDocumentGDI.Create;

dosome(canv);

this is not going: 
false
lPdf.Canvas:=canv; because property.

Could you help me witht a peace of code?

Thanks a lot

loris

#5 PDF Engine » PrinterCanvas to SynPdf » 2014-02-23 18:10:23

loris
Replies: 5

Salut Arnaud,Hello
Is there any possibility to set PrinterCanvas or printerobject to SynPdf?

var
p:TPrinter;
lPdf : TPdfDocumentGDI;
begin
lPdf   := TPdfDocumentGDI.Create;
p:=TPrinter.Create;
p.BeginDoc;
p.Canvas.TextOut(0,0,'Salut');
{--------------------------------}
lPdf.Canvas:=p.Canvas?
{--------------------------------}

OR

lPdf   := TPdfDocumentGDI.Create(p);
{-----------------------------------------------------}
lpdf.SaveToFile('c:\cafaitplaisir.pdf');
lpdf.Free;
p.EndDoc;
p.Free;
end;

Because I've thousand of lines with the printercanvas, and I'could not change it so easy.

Regards,

Loris

Board footer

Powered by FluxBB