Interesting behaviour for PaperName when loading template
Hi,
I have a template file with PaperSize set to 'Custom' (215x203 mm). When
I load the template the papername is set to 'A4' where as it should have
been 'Custom' (but the values of paperwidth and paperheight are same as
the custom papersize not A4!).
The funny thing is when I set a breakpoint to the line whichs loads the
template, the papername is set to 'custom' and everything is OK; when I
remove the breakpoint and run again the papername is set to 'A4'?
Any ideas?
Best Regards
Bora Aydemir
I am using Delphi6, RB 6.03 EE, Lexmark 2380 Plus
I have a template file with PaperSize set to 'Custom' (215x203 mm). When
I load the template the papername is set to 'A4' where as it should have
been 'Custom' (but the values of paperwidth and paperheight are same as
the custom papersize not A4!).
The funny thing is when I set a breakpoint to the line whichs loads the
template, the papername is set to 'custom' and everything is OK; when I
remove the breakpoint and run again the papername is set to 'A4'?
Any ideas?
Best Regards
Bora Aydemir
I am using Delphi6, RB 6.03 EE, Lexmark 2380 Plus
This discussion has been closed.
Comments
load it to print it? I tried doing this in the designer and all the settings
are restored properly, including the paper name. Can you send the template
with which you are having this problem to support@digital-metaphors.com.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I happens when I load the template at application startup to print
whenever its called.
Is papername property important when printing? I can see that the width
and height properties of the template are correct but papername isn't.
If width-height are enough to print correctly to a custom papersize then
I should concentrate on the printer itself.
I found out that the papername defaults to the value set at design time.
(In my case A4).
I created a small app that demonstrates how it happens. I can send it
over with the template.
Thanks for your time
Bora Aydemir
Monad Software & Consultancy Inc
I found out that papername IS important during my trials. But I found a
work around for the problem (bu it doesn't make sense to me but it
definitly works).
the original code which produces faulty papername (A4 instead of Custom) is:
ppReport.Template.FileName := TemplateName;
ppReport.Template.LoadFromFile;
the workaround? I found is simply referring to the papername and loading
the template again:
ppReport.Template.FileName := TemplateName;
ppReport.Template.LoadFromFile;
mmoPrinter.Lines.Add(
'Paper Name: ' + ppReport.PrinterSetup.PaperName);
ppReport.Template.LoadFromFile;
Any ideas?
Bora Aydemir
Thanx for your feedback, Ronaldo.