VoyForums

VoyUser Login optional ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 12345678910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 11:46:43 11/28/07 Wed
Author: Peterson (Outputfile always blank)
Subject: TEnvisionPrinter

I am trying using the TEnvision Printer, but the outputfilename is always blank.
What´s wrong in my code ?



var
Graphic : TTiffGraphic;
GraphicPrinter : TDibGraphicPrinter;
Fs : TFileStream;
Resize : TResizeTransform;
Altura : Double;
Largura : Double;
EnviPrinter : TEnvisionPrinter;

begin



Graphic := TTiffGraphic.Create;

GraphicPrinter := TDibGraphicPrinter.Create;

Fs := TFileStream.Create('E:\Atos\Imagens\Livro2\034100\03419520.02V',fmOpenReadWrite);
Try
Graphic.LoadFromStream(Fs);
finally
Fs.Free;


Altura :=CmtoInches(32.9);
Largura :=CmtoInches(20.9);

Resize := TResizeTransform.Create;
Resize.Width := Trunc(Largura * Graphic.XDotsPerInch);
Resize.Height:= Trunc(Altura * Graphic.YDotsPerInch);
Resize.Apply(Graphic);
Resize.Free;


EnviPrinter := TEnvisionPrinter.Create;
try

GraphicPrinter.PrintMode := pmSpecificWidthAndHeight;
GraphicPrinter.UsePrintJob := False;

GraphicPrinter.Width := Trunc(PixelsToInches(Graphic.Width,Graphic.XDotsPerInch));

GraphicPrinter.Height := Trunc(PixelstoInches(Graphic.Height,Graphic.YDotsPerInch));

EnviPrinter.OutputFileName := 'E:\envis.tiff';
EnviPrinter.ImageFormat := ifBlackWhite;

Printer.BeginDoc;
EnviPrinter.BeginDoc;
GraphicPrinter.Print(Graphic);

EnviPrinter.EndDoc;
Printer.EndDoc;
finally

GraphicPrinter.Free;
EnviPrinter.Free;
end;
end;
end;

[ Next Thread | Previous Thread | Next Message | Previous Message ]

VoyUser Login ] Not required to post.
Post a public reply to this message | Go post a new public message
* Notice: Posting problems? [ Click here ]
* HTML allowed in marked fields.
Message subject (required):

Name (required):

  Expression (Optional mood/title along with your name) Examples: (happy, sad, The Joyful, etc.) help)

  E-mail address (optional):

Type your message here:


Notice: Copies of your message may remain on this and other systems on internet. Please be respectful.

[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 2.94, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2008 Voyager Info-Systems. All Rights Reserved.