0

I have a little problem with my application. I want to add a text to a PDF but with a little special thing. The text has to be italic, but the angle of italic is too high! Italic has a angle of 11 degrees but I need 10 degrees!

I don't know how itextsharp works, if there is a function which creates a new italic function which is another like Visual Studio uses. Then I could edit the library, but I don't know how.

Or is there a possibility to create my own function which does what I want?

I don't need a rotation I need a angle like italic.

Thanks for you help.

Scath
  • 3,777
  • 10
  • 29
  • 40
  • How do you request italics in iTextSharp? Do you use an actual italic font or do you employ poor man's italics? (If you're not sure, show appropriate code.) – mkl Aug 25 '17 at 04:47

1 Answers1

1

There is a method you can call on Chunk that does this for you.

Chunk chunk = new Chunk("Hello world",  
                        FontFactory.getFont(FontFactory.COURIER, 
                                            20, 
                                            Font.NORMAL, 
                                            new BaseColor(255, 0, 0)));  
chunk.setSkew(0, 25);
document.add(chunk);

The method setSkew does all the magic here.

For more details, check out http://developers.itextpdf.com/examples/itext-action-second-edition/chapter-3

It also shows examples of using this method.

Joris Schellekens
  • 8,483
  • 2
  • 23
  • 54