PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Vertical Text

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
jpavez



Joined: 17 Dec 2007
Posts: 4
Location: Chile

PostPosted: Fri Dec 21, 2007 9:03 pm    Post subject: Vertical Text Reply with quote

I need posisioning vertical text exactly in a XPoint.

I try using a rectangle, from "top + height" to "top".

Still can't do it...

Code:

                        XGraphicsState gs = gfx.Save();                       
                        XGraphicsPath path = new XGraphicsPath();
                        gfx.TranslateTransform(45.0 , 10.0 + rect.Height / 3.0);
                        gfx.RotateTransform(-90);
                        gfx.TranslateTransform(-45.0 , -10.0 - rect.Height / 3.0);
                        rect.Width = rect.Height;
                        rect.Height = 20;
                        XTextFormatter tf = new XTextFormatter(gfx);
                        tf.Alignment = XParagraphAlignment.Center;
                        gfx.DrawPath(new XPen(pen.Color, 0.5), brush, path);
                        XRect rectVerticalText = new XRect(-rect.Top,rect.Left, rect.Width, rect.Height);
                        gfx.DrawRectangle(brushBlack,rectVerticalText);
tf.DrawString(ndName, font, brushFont, rectVerticalText, XStringFormat.TopLeft);
                             
                        gfx.Restore(gs);


Regards, Josť.[/code]
_________________
Salu2, JPavez
Back to top
View user's profile Send private message Send e-mail
tranquillo



Joined: 20 Sep 2007
Posts: 15

PostPosted: Mon Jan 21, 2008 9:24 am    Post subject: Reply with quote

not sure what you're trying to do but this is the code I use to write vertical text to a specific rectangle (point, size);

XRect spineTitleBox = new XRect(rectangleY, document.width - rectangleX, TitleSize.Width, TitleSize.Height);

// Since you "turn the paper" you're writing to, the Y pos when you hold the paper upright becomes the X pos, and the new Y pos, is the total width of the document - the original X pos.

// set a new xy=0 pos
xgf.TranslateTransform(page.Width/2, page.Height/2);
// turn the paper from the ny xy=0
xgf.RotateTransform(90);
// reset the xy=0 to the upper left corner.
xgf.TranslateTransform(-page.Height/2, -page.Width/2);

// write your stuff
if(!string.IsNullOrEmpty(book.Title))
{
XBrush brush;
brush = Brushes.Black;

xgf.DrawString(book.Title, spineTitleFont, brush, spineTitleBox, XStringFormat.Center);
}

// set a new yx=0 pos
xgf.TranslateTransform(page.Height/2, page.Width/2);
// turn the paper back
xgf.RotateTransform(-90);
// reset the xy=0 to the upper left corner
xgf.TranslateTransform(-page.Width/2, -page.Height/2);
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com