我正在使用 ABCpdf7 创建一个 pdf,在某些情况下我想添加一个“类似水印”的文本以显示在文档的所有页面上。每当我在所有页面上使文本唯一时,它都会按预期工作,但如果它在所有页面上都是相同的文本,它会忽略我的 alpha 属性。
我似乎无法使用 objectID 并在它不是图像时引用它,并且由于 pdf 将提供多种不同语言的版本,因此恐怕无法仅使用文本创建图像并添加它.. .
例如,这有效:
theDoc.HPos = 0;
theDoc.VPos = 0;
theDoc.Rect.SetRect(250, 265, 500, 80);
theDoc.Transform.Rotate(55, 250, 265);
theDoc.FontSize = 72;
theDoc.Color.String = "0 0 0 a70";
Page[] pages = theDoc.ObjectSoup.Catalog.Pages.GetPageArray();
foreach (Page p in pages)
{
theDoc.Page = p.ID;
var dummy = theDoc.PageNumber.ToString();
theDoc.AddText("Unpublished" + dummy);
}
...但这不起作用:
theDoc.HPos = 0;
theDoc.VPos = 0;
theDoc.Rect.SetRect(250, 265, 500, 80);
theDoc.Transform.Rotate(55, 250, 265);
theDoc.FontSize = 72;
theDoc.Color.String = "0 0 0 a70";
Page[] pages = theDoc.ObjectSoup.Catalog.Pages.GetPageArray();
foreach (Page p in pages)
{
theDoc.Page = p.ID;
theDoc.AddText("Unpublished");
}
我觉得我在这里遗漏了一些非常明显的东西,但似乎无法弄清楚是什么......