Rotated Text

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
Ederino
Posts: 6
Joined: Mon Mar 28 2005

Rotated Text

Post by Ederino »

I am trying to print rotated text Using the AMYUNI 2.5 converter product and VB.NET. Being somewhat new to VB.Net I have developed a method that works when printing directly to the printer but when printing to PDF, the text area appears as a big black rectangle. The black rectangle is however rotated at the proper angle. The code I am using is as folows:

Public Function DrawStringRotated(ByVal strText As String, ByVal intX As Integer, ByVal intY As Integer, _
ByVal intDegreesRotation As Integer, ByVal objFont As Font)
Dim objContainer As System.Drawing.Drawing2D.GraphicsContainer

objContainer = mobjCanvas.Graphics.BeginContainer()
mobjCanvas.Graphics.TranslateTransform(intX, intY)
mobjCanvas.Graphics.RotateTransform(intDegreesRotation)
Me.DrawStringLeftJustified(strText, 0, 0)
mobjCanvas.Graphics.EndContainer(objContainer)
End Function

The MobjCanvas object is the ystem.Drawing.Printing.PrintPageEventArgs object from the pringPage event of a printDocument object. Any degrees rotation value other than 0 reaults in the black box.

Does anyone have a better example of how to do this or what am I doing wrong.

Thank you...
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

I am new to .Net myself too so I can't help you with your code, I hope if there are some VB.Net developers here they would be able to help.

I can suggest you however to try to write the rotated text on a Word document by example and then print it directly to the PDF Printer, will you get any problem? I guess you will not.

Also another suggestion would be to try to add Postscript simulation when printing to the PDF Printer. You can add Postscript simulation by calling SetSimPostscript() or SimPostsript() of CDIntf depending on wether you are using the DLL or ActiveX interface of CDIntf250.

Hope this helps.
Ederino
Posts: 6
Joined: Mon Mar 28 2005

Rotated Text

Post by Ederino »

Joan,
Thanks, setting the SimPostsript() property to true did the trick!

Ed
Post Reply