PdfSharpCore icon indicating copy to clipboard operation
PdfSharpCore copied to clipboard

How to get Chinese Annotations?Help Help!!

Open 1031918012 opened this issue 2 years ago • 0 comments

企业微信截图_16722212804536

PdfPage page = document.AddPage(); PdfTextAnnotation textAnnot = new PdfTextAnnotation { Title = "标题乱码", Subject = "22222", Contents = "11111.\r11111.123", Opacity = 0.5, Open = true, Icon = PdfTextAnnotationIcon.NoIcon,

};

XGraphics gfx = XGraphics.FromPdfPage(page);

XFont font = new XFont("KaiTi", 14, XFontStyle.Bold);

gfx.DrawString("这是我要写的一句话", font, XBrushes.Black, 30, 50, XStringFormats.BottomLeft);

// Convert rectangle from world space to page space. This is necessary because the annotation is // placed relative to the bottom left corner of the page with units measured in point. XRect rect = gfx.Transformer.WorldToDefaultPage(new XRect(30, 30, 30, 30)); textAnnot.Rectangle = new PdfRectangle(rect);

page.Annotations.Add(textAnnot);

1031918012 avatar Dec 28 '22 09:12 1031918012