Outlines and Destinations

2023-11-28 10:20
文章标签 destinations outlines

本文主要是介绍Outlines and Destinations,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

Console.WriteLine("Chapter 11 example 7: Outlines and Destinations");

// step 1: creation of a document-object
Document document = new Document();

try
{

// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream("d:/pdf/Chap1107.pdf", FileMode.Create));

// step 3: we open the document
document.Open();

// step 4: we grab the ContentByte and do some stuff with it
PdfContentByte cb = writer.DirectContent;

// we create a PdfTemplate
PdfTemplate template = cb.CreateTemplate(25, 25);

// we add some crosses to visualize the destinations
template.MoveTo(13, 0);
template.LineTo(13, 25);
template.MoveTo(0, 13);
template.LineTo(50, 13);
template.Stroke();

// we add the template on different positions
cb.AddTemplate(template, 287, 787);
cb.AddTemplate(template, 187, 487);
cb.AddTemplate(template, 487, 287);
cb.AddTemplate(template, 87, 87);

var moreRecordRef = new Chunk("link A");
moreRecordRef.SetLocalGoto("more");
//moreAnchor.SetLocalDestination("#more");

// we define the destinations
PdfDestination d1 = new PdfDestination(PdfDestination.XYZ, 300, 800, 0);
PdfOutline out1 = new PdfOutline(cb.RootOutline, d1, "root");
PdfDestination d2 = new PdfDestination(PdfDestination.FITH, 500);
                PdfDestination d3 = new PdfDestination(PdfDestination.FITR, 200, 300, 400, 500);
                PdfDestination d4 = new PdfDestination(PdfDestination.FITBV, 100);
                PdfDestination d5 = new PdfDestination(PdfDestination.FIT);

// we define the outlines
PdfOutline out2 = new PdfOutline(out1, d2, "sub 1");
PdfOutline out3 = new PdfOutline(out1, d3, "sub 2");
PdfOutline out4 = new PdfOutline(out1, d4, "sub 2.1");
PdfOutline out5 = new PdfOutline(out1, d5, "sub 2.2");
cb.AddOutline(out1);
cb.AddOutline(out2);
cb.AddOutline(out3);
cb.AddOutline(out4);
cb.AddOutline(out5);  
}
catch (DocumentException de)
{
Console.Error.WriteLine(de.Message);
}
catch (IOException ioe)
{
Console.Error.WriteLine(ioe.Message);
}

// step 5: we close the document
document.Close();
}

转载于:https://my.oschina.net/yayalyon/blog/16716

这篇关于Outlines and Destinations的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/429526

相关文章

canal监控mysql变化的问题-NoNode for /otter/canal/destinations/example/cluster

原因:没有节点 解决:到canal的安装目录下面,查看canal的配置文件,发现没有指定canal.zkServers的地址! canal.properties

PDF格式分析(二十四)Destinations

Destinations定义文档的特定视图,包括以下各项: •应显示的文档页面 •该页面上文档窗口的位置 •放大(缩放)系数 Destinations应用于outline,注释(“Link注释”)或Action(“Go-To Actions”和“Remote Go-To Actions“)。 Destination是一个数组对象,具体语法如下: [page /XYZ left top

ORA-16014: log 18 sequence# 509 not archived, no available destinations

问题描述 数据库有大量锁表,但是不影响生产,因此准备重启。 查看实例状态 [oracle@testrac1 ~]$ srvctl status database -d racdbInstance racdb1 is running on node testrac1Instance racdb2 is running on node testrac2[oracle@testrac1 ~]