Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1901
  • Last Modified:

How to draw an ARC using iTextSharp

Hi there,
I have been producing my own pdf documents using VB.NET and iTextSharp.  So far it has all been going ok but I can't seem to be able to draw an arc.  No matter what I try it always seems to end up being a straight line.

Can someone please help me.

I have tried many different combinations of values.  The line that is generated moves but is still a straight line.

I'm trying to draw half of an ellipse.

Dim FileStream as new IO.FileStream("C:\test.pdf", IO.FileMode.Create)
Dim doc As new Document
Dim writer As iTextSharp.text.pdf.PdfWriter = pdf.PdfWriter.GetInstance(doc, FileStream)
Dim cb As PdfContentByte = writer.DirectContent

doc.SetPageSize(PageSize.A4)

cb.Arc(100, 100, 100, 200, 135, 180)
cb.Stroke()

FileStream.Close()
FileStream.Dispose()

Open in new window

0
SoLost
Asked:
SoLost
1 Solution
 
SoLostAuthor Commented:
Don't worry.  After all that I found the "CurveTo" method that does what I want.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now