c# - 如何在 iTextSharp 中旋转文本?

标签 c# text itext rotation

我已经在网上搜索过了,但看起来并不那么容易,我怎样才能旋转我的文字?

Document doc = new Document(new iTextSharp.text.Rectangle(600, 800), 0, 0, 0, 0);
PdfWriter.GetInstance(doc, new FileStream(Directory.GetCurrentDirectory() + "/genpdf.pdf", FileMode.Create));

doc.Open();

iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(file);
Chunk c1 = new Chunk("~Comment~"); //rotate 270°

doc.Add(image);
doc.Add(text);

doc.Close();

最佳答案

答案在Rotate text answer

writer是一个PdfWriter类型,你可以这样获取:

using (stream = new FileStream(temp_filename, FileMode.Create))
{
    iTextSharp.text.Document document = new iTextSharp.text.Document();
    PdfWriter writer = PdfWriter.GetInstance(document, stream);

关于c# - 如何在 iTextSharp 中旋转文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8324146/

相关文章:

C++ SFML 字体问题

javascript - 查找适合多少个字母的div

java - 将控制台输出转换为 PDF 文件

java - 使用 Java iText API 将 SWT 图像导出为 PDF

c# - WPF 工具提示 : Is there any option to Click on a Button that is inside tooltip (code and picture attached)

c# - 如何在 C# 中确定多播数据包的源 IP?

c# - 对于 jpg 图像文件,获得 3-4 种平均主色

c# - 使用模拟创建 Windows 文件夹

java - Spring Web应用程序将文件保存到服务器

text - Flutter:文本剪辑在连续时不起作用