Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print image

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I have a tif image that contains two pages of a juror questionnaire.

The files are stored in
R:\Case Management\JMSv2\Questionnaires

they are stored based on the juror's unique ID:

32123.tif
32124.tif
32124.tif

I run a query, get all the juror numbers that I need and then need to print the corresponding tif. The user doesn't need to see the image, it just needs to print in the background.

So, if the query returns 32123 and 32125, I would only need to print those files.

Any suggestions?

Thanks!

Leslie
 
Being TIF one of the most convoluted and complex formats known to mankind I fear you have only two options:

a) Get a Delphi component able to print it (try in Torry's Delphi Pages) or

b) Get some Activex able to print it and import it in Delphi.

I think "b" is your best bet.

buho (A).
 
well, I can save it as a different file type if you have a suggestion that will accomplish what I need.

Thanks,
leslie
 
Ok, I can save it as a multipage PDF or I can save multiple files (32123A and 32123B) in any other format (gif, jpg). If it's a multi file image I still need to be able to print double sided.

Thanks for any insight!

les
 
The Delphi TPrinter object have a canvas you can operate with.

So, having the graphics in any format easily translatable to BMP will do the work (you can use BMP itself, or you can use JPG and convert to a BMP bitmap after loading).

buho (A).





 
Acrobat Reader have an Activex you can import in Delphi. Never used it, but it is there in any machine having the reader.

buho (A).
 
Ok, so I looked into the ActiveX component and found this posting by Giovanni Caramia (Thread102-824415)

You can use pdf.ocx.
If you have acrobat reader installed, you can find it in ProgramFiles\Adobe\Acrobatx\Rreader\Activex

Install in (Components\installactivex\ ...)

Open a new project, drag the component on the form

procedure TForm1.Button1Click(Sender: TObject);
begin
pdf1.src := ...\mypdf.pdf';
end;

So I'm going to see!
 
Anyone? Any clue why this doesn't print???
Code:
procedure TfrmTrialInitialization.PrintQuestionnaires(ATrialNumber : string);
var NewPDFapp : TAcroPDF;
begin
  with qryTrialJurors do
  begin
    SQL.Clear;
    SQL.Add('SELECT JURNUM FROM JMPPANEL WHERE TRIALNUM = ' + ATrialNumber);
    Active := True;
    NewPDFapp := TAcroPDF.Create(Self);
    While not eof do
    begin
      NewPDFapp.src := 'R:\Case Management\JMSv2\Questionnaires\' + FieldByname('JURNUM').AsSTring + '.pdf';
      NewPDFapp.printall;
      Next;
    end;
    NewPDFapp.Destroy;
  end;
end;

I have tried Print, PrintPages(1, 2), PrintAll, every print function I can find!

When I open the Acrobat program from the Start menu and look at the recent files, I can see that all the files I'm trying to print are the ones in the recent file listing, so it looks like it's at least getting the pdf document, but it's not printing.

Thanks!

les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top