#1 PDF Engine » DrawText() and picture on same row and space between rows » 2012-10-17 17:36:53

delphi_prog
Replies: 1

I enter .bmp file and text in my pdf as follows:

Font.Name := 'Calibri';
Font.Size := 11;
Font.Style := [fsBold,fsItalic];
DrawText('PACKAGE NO');

Logo.Picture.LoadFromFile('logoCert.bmp');

1.
Every time i want to add something i get new row automatically even if i don't call it myself. And the space between rows depends on font size. Is there any way to make every space between different font rows the same?

2.
Is it possible to position my picture file on the same row with the text like this:

--------------
|text      ***  |
|text      ***  |
|text      ***  |
|text      ***  |
|           ***  |
|                  |
--------------

The frame is my paper layout and the dot rows represent one big picture. Hope thats clear enough for you guys smile.

Hope someone can help me.

#3 Re: PDF Engine » How to add picture file to pdf » 2012-06-21 21:20:27

Tryed to follow your instructions (not sure if i found the right thing). But i found procedure in SQLite3Pages:

procedure TGDIPages.DrawBMP(rec: TRect; bmp: TBitmap);
begin
  if self=nil then exit; // avoid GPF
  if not fHeaderDone then
    DoHeader;
  PrintBitmap(fCanvas, MmToPrinter(rec), bmp);
end;

Cant understand what is Trec and how do i have do declare rec and bmp to use them in my program?

#4 PDF Engine » How to add picture file to pdf » 2012-06-21 09:13:54

delphi_prog
Replies: 3

Hi!

I have created pdf with text, but i cannot find how to add picture (any format). I am looking for the easiest source code to do this. It would be nice if anyone could add all the implementation uses and etc too.

I am using the method with canvas and tried this: 

with TPdfDocument.Create do

  try

    AddPage;

    Canvas.DrawXObject(10,10,10,10, 'Picture.bmp');

    Canvas.SetFont('Times new roman',30,[{fsItalic,}{fsBold}]);

This is not working. Can someone help me?

Board footer

Powered by FluxBB