admin 管理员组

文章数量: 1086019


2024年5月20日发(作者:verilog数组赋值)

gnostice pdftoolkit 例子

以下是gnostice pdftoolkit的一些例子:

1. 导出PDF页面为图像:

```csharp

using ;

PDFDocument doc = new PDFDocument("");

PDFFirstPage firstPage = e(1);

PDFFormat format = new

PDFFormat();

ality = 80;

ToImage("", format);

();

```

2. 添加文本到PDF页面:

```csharp

using ;

PDFDocument doc = new PDFDocument("");

PDFPage page = e(1);

PDFGraphics graphics = Graphics();

PDFBrush textBrush = new PDFBrush();

= ;

PDFPen textOutlinePen = new PDFPen();

= ;

= 0.5f;

PDFTextState textState = new PDFTextState();

= new

StandardType1Font(ica);

ze = 12;

ate();

sh(textBrush);

(textOutlinePen);

tState(textState);

xt("Hello, PDF!", 100, 100);

eState();

("");

();

```

3. 提取PDF文本内容:

```csharp

using ;

PDFDocument doc = new PDFDocument("");

PDFTextExtractor textExtractor = new PDFTextExtractor();

string text = tText(doc);

ine(text);

();

```

这些例子展示了gnostice pdftoolkit的一些常见用法,你可以根

据具体的需求进行调整和扩展。请注意,在使用这些例子之前,

确保已经正确引用了gnostice pdftoolkit的相关程序集。


本文标签: 页面 文本 扩展