Flip or Rotate the Canvas
I need to print a label upside down. I can rotate a canvas but I can not
seem to find where I should do this. I always seem to be rotating the
printer canvas prior to anything being written to it.
Is there an event that fires after the printer.canvas has been written on
but prior to it being sent to the printer that I can access???
Thanks
seem to find where I should do this. I always seem to be rotating the
printer canvas prior to anything being written to it.
Is there an event that fires after the printer.canvas has been written on
but prior to it being sent to the printer that I can access???
Thanks
This discussion has been closed.
Comments
Before trying to rotate the label on your own, I suggest checking out the
RotatedText component available for download from our web site. This add-on
component offers an Angle property to a normal TppLabel. You can download
this component in the friends | rcl section of our website
(http://www.digital-metaphors.com).
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
if there were others.
Thanks
Any other suggestions? The RotatedText component is not an option for
us?
Paul
Adding a native rotated label to ReportBuilder is currently on our "To-Do"
list. For now, you might have a look at the TppBarCode component. This
component has the ability to rotate in 90 Degree increments and uses the
ppTextOutRotate function located in the ppDrwCmd.pas file as a general
routine. The RotatedText add-on component uses this method as well. I
would suggest taking a look at it and see if you can use it for your needs
or perhaps give you some clues on how you could implement a solution.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I have spent some time looking at this and also have now spent money
talking to a Tech support engineer. The problem is that the RotatedText
add-on does not allow word wrap or aligning of the text. So again it fails
to really do what we need. I am wondering if createing a custom
printerdevice might be a solution to take the whole printerdevice canvas
prior to finalizing and rotate the Canvas. I talked to Nard about this and
at first we thought it might work but I later recieved an e-mail that
looking at the RotatedText would be a better solution. I am looking for all
the help I can get on this because the problem must be solved.
Thanks
This question is being handled via support@digital-metaphors.com.
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
customer packing ticket that includes a coupon at the end. We are using
RichText for formatting and wanted to rotate it sideways.
Thanks,
Rick Whitaker
Iowa Glass Depot
Below was my last response on this issue. My recommended solution for their
needs was to descend from TppDBText and implement a custom draw command
class that could render the text rotated by 180 degrees.
TppDBText -> TppDrawText (RB built in classes)
TmyDBText -> TDrawRotatedText (DBText descendant, draw command class from
the rotated text component).
For RichText, the draw command class is TppDrawRichText. It is located in
ppDrwCmd.pas. You might be able to implement a draw command class that can
rotated the rich text 90 degrees. When drawing to the screen, the RichText
is renderes to a MetaFile and then drawn to the screen canvas. You could
implement a similar approach that draw the RichText to a metafile and then
rotates the metafile to the screen/printer canvas.
----------------
Here is my response to the originaly question......
The hierarchy for the RotateLabel component looks like this:
TppPrintable (ppPrnabl.pas)
TppComponent (ppClass.pas)
TppCustomComponent (ppCtrls.pas)
TppCustomText (ppCtrls.pas)
TRotatedLabel
The WordWrap property is defined in TppPrintable. It is redeclared by
TppLabel to be published. Many properties are declared by ancestors by then
not really supported. It is up to descendants to publish the propery and
provide the necessary behavior to for the property.
I can now think of two ways to proceed (the second approach seems like the
way to go).
1. Add support for WordWrap to TRotatedLabel. (see TppLabel in ppCtrls.pas
for an example).
2. Since you only need to rotate the component by 180 degrees, perhaps a
simpler approach would be to descend from TppDBText and implement a custom
draw command class that is used to render to preview and printer. The draw
command class would be TDrawRotatedText or a variation of it).
Define a class such as
TmyRotatedText = class(TppDBText)
Override the constructor to associate the custom draw command class:
constructor TmyRotatedText .Create(AOwner: TComponent);
begin
inherited Create(AOwner);
DrawCommandClass := TDrawRotatedText;
end;
Implement the PropertiesToDrawCommand class (see RotatedLabel and DBText for
examples).
procedure TmyRotatedText.PropertiesToDrawCommand(aDrawCommand:
TppDrawCommand);
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
to find built-in support for rotation (at least at 90, 180,
and 270) for labels and dbtext with alignment at a minimum.
Thanks.
Sorry, there is no built in support yet for rotating text components.
Thanks for the suggestion.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com