I have a pdfptable with some pdfpcells and this sheet is printed off and brought around with each part. When the part is on the rack, the sheets are upside down. How can I write some text into a pdfpcell and then rotate it 180 degrees?
Asked
Active
Viewed 605 times
2 Answers
1
pdfpcells details here: http://api.itextpdf.com/itext/com/itextpdf/text/Image.html
[Edit] Ignore below method, use setRotation as Dah discovered below. Thanks for the upvote Dah, I didnt deserve it :)
You will have to create an image, draw your text to the image, translate the image to -y, or rotate the image.
Then write the image to url, and then pass that image url into the constructor for an 'com.itextpdf.text.Image'.
For drawing text in an image: Java - Draw text in the center of an image
g2d.translate(0, 2 * imageHeight + gap);
g2d.scale(1, -1);
OR
Rotate the image: Java: Rotating Images
Then:
Write an image to a file: http://docs.oracle.com/javase/tutorial/2d/images/saveimage.html

Community
- 1
- 1

Damienknight
- 1,876
- 2
- 18
- 34
-
1It may also be possible using unicode to draw upside down characters. http://www.fileformat.info/convert/text/upside-down-map.htm – Damienknight Apr 01 '13 at 20:02
-
Nah, you supplied 3 methods of doing it. I'd rather accept yours. We both screwed up. – davidahines Apr 02 '13 at 15:55