首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

使用ITextSharp编辑PDF格式的超链接和锚点

关于使用ITextSharp编辑PDF格式的超链接和锚点,以下是完善且全面的答案:

  1. 超链接

超链接是指在PDF文档中,通过链接可以跳转到其他文档、网页或其他位置的功能。在ITextSharp中,可以使用PdfAction和PdfAnnotation来实现超链接。

以下是一个示例代码,演示如何在PDF文档中添加超链接:

代码语言:csharp
复制
using System;
using System.IO;
using iTextSharp.text.pdf;

namespace ITextSharpExample
{
    class Program
    {
        static void Main(string[] args)
        {
            // 创建一个新的PDF文档
            Document document = new Document();
            PdfWriter.GetInstance(document, new FileStream("output.pdf", FileMode.Create));
            document.Open();

            // 添加一个超链接到其他PDF文档
            Chunk link = new Chunk("点击这里跳转到其他PDF文档");
            PdfAction action = PdfAction.GotoLocalPage(1, new PdfDestination(PdfDestination.FIT), document);
            link.Action = action;
            document.Add(link);

            // 添加一个超链接到网页
            link = new Chunk("点击这里跳转到网页");
            action = PdfAction.GotoEmbedded("http://www.example.com", false, false);
            link.Action = action;
            document.Add(link);

            // 关闭文档
            document.Close();
        }
    }
}
  1. 锚点

锚点是指在PDF文档中,通过链接可以跳转到文档中的指定位置的功能。在ITextSharp中,可以使用PdfDestination来实现锚点。

以下是一个示例代码,演示如何在PDF文档中添加锚点:

代码语言:csharp
复制

using System;

using System.IO;

using iTextSharp.text;

using iTextSharp.text.pdf;

using iTextSharp.text.pdf.draw;

namespace ITextSharpExample

{

代码语言:txt
复制
class Program
代码语言:txt
复制
{
代码语言:txt
复制
    static void Main(string[] args)
代码语言:txt
复制
    {
代码语言:txt
复制
        // 创建一个新的PDF文档
代码语言:txt
复制
        Document document = new Document();
代码语言:txt
复制
        PdfWriter.GetInstance(document, new FileStream("output.pdf", FileMode.Create));
代码语言:txt
复制
        document.Open();
代码语言:txt
复制
        // 添加一个标题,作为锚点的目标位置
代码语言:txt
复制
        Paragraph header = new Paragraph("这是一个标题,作为锚点的目标位置");
代码语言:txt
复制
        string targetName = "target";
代码语言:txt
复制
        PdfDestination destination = new PdfDestination(PdfDestination.FIT, header.GetTop(document));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.FITH, header.GetTop(document)));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.FITV, header.GetTop(document)));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.FITB, header.GetTop(document)));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.FITBH, header.GetTop(document)));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.FITBV, header.GetTop(document)));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new PdfDestination(PdfDestination.XYZ, header.GetTop(document), header.GetLeft(document), 1));
代码语言:txt
复制
        destination.AddFirst(new P
页面内容是否对你有帮助?
有帮助
没帮助

相关·内容

CSharp每日代码示例:使用iTextSharp创建PDF文件

本文演示如何使用iTextSharp PDF库将文本文件转换为PDF文件。 iTextSharp是一个从JAVA项目iText衍生的.Net版本的开源项目,采用GPL许可证发布。...,块可以用于构建其他基础元素如短句、段落、锚点等,块是一个有确定字体的字符串,要添加块到文档中时,其他所有布局变量均要被定义。...以使用IndentationLeft和IndentationRight,FirstLineIndent属性设置缩排; 六、锚点(Anchor) 如果你想在文档中添加一个外部链接(例如使用URL链接到WEB...; anchor.Name = "website"; 如果你想添加内部链接,你需要选择该链接不同的名称,就象你相位在HTML中利用名称作为锚点一样。...和使用iTextSharp工具转换为单个PDF的代码 The Code 1.

3.1K10

强大的 .NET PDF处理神器:PDFSharp

前言 PDFSharp是一款开源的.NET库,专为处理PDF文档而设计。它以其丰富的功能和易用性赢得了广大开发者的青睐。无论是创建、编辑、合并、拆分还是转换PDF文件,PDFSharp都能轻松应对。...://www.e-iceblue.cn/Introduce/Spire-Office-NET.html iTextSharp:https://github.com/itext/itextsharp 有一说一都挺好用的...尝试使用了下,还不错,该有的都有,简单的pdf文件可以直接使用PDFSharp库生成,复杂点的则提供了MigraDoc来编辑。 自己的小应用都已经上生成环境了,觉得该库是挺ok的了。...3、格式化:提供字体选择、颜色设定、布局调整等样式控制功能,帮助您创建高度定制化的PDF文档。 4、合并与拆分:能够将多个PDF文档合并成一个,或将一个PDF文档拆分成多个部分。...PDFSharp文档 .NET Framework 文档站点下有很多例子大家可以看看 我的使用方式较为粗暴,使用MigraDoc编辑文档表格,再生成PDF文件。

2.2K10
  • java PDF开源库选择与iText发展历史

    这一特点使它成为在Internet上进行电子文档发行和数字化信息传播的理想文档格式。越来越多的电子图书、产品说明、公司文告、网络资料、电子邮件在开始使用PDF格式文件。...总结一下就是PDF是一种文件格式,只要按照这种文件格式谁都能创建、阅读和编辑PDF文档。...之前一直以为PDF是Adobe的产物是有版权,其余的阅读器什么都是向Adobe公司申请版权的,才发现自己理解错了,只要你有能力完全可以自己设计PDF阅读器和编辑器 1.2 PDF SDK 对于我们开发人员来说...Adobe PDF SDK和Foxit PDF SDK资料很齐全,函数功能也很齐全,但是缺乏编辑和创建模块,相应的模块都是需要申请试用和购买。...iText库的.NET版本,并且与iText版本号同步,iText 5.0.0和iTextSharp5.0.0同时发布 Java方面,使用Java 5/JDK 1.5 iText开始逐渐专业化,iText

    7K30

    .NET Core.NET5.NET6 开源项目汇总1:常用必备组件

    它基于关注点分离的理念,将数据与表格样式、字体格式分离。 其中模板承载的表格样式、字体格式在可视化的情况下编辑。开发人员只需要绑定数据与目标标签的对应关系。...ExcelReport.Driver.NPOI是使用NPOI对ExcelReport.Driver的实现。支持xls、xlsx两种格式的Excel文档。...使用 itextsharp.lgplv2.core 把Html转PDF https://www.cnblogs.com/ping9719/p/12759848.html....Net Core 使用 itextsharp.lgplv2.core 生成PDF https://blog.csdn.net/weixin_30737363/article/details/96669770...可以自动更新文档中的字段。 在Word文档中插入html/rtf文本(带标记)或html/rtf文档。 克隆列表或表。 添加或修改复选框。 设置图片透明度。 基于引用的超链接创建格式化的超链接。

    4.1K10

    文档在线预览的实现

    这一点微软的高级解决方案是使用RMS,能够设置每个用户的打开权限,是否打印等,要求必须是域内,而且只管理Office文件的权限,对txt,pdf就没办法了。...这就就是百度文库,豆丁之类的网站的功能。下面来说说怎么实现。 1.文档统一转换为pdf 这里的文档我们要看是什么格式,不同的格式有不同的转换方法。...如果是文本需要转换为PDF,我们可以使用iTextSharp这个组件,对于纯文本,注意的是源文件中没有设置字体之类的,需要在转换成PDF时指定字体,否则对于中文可能由于没有设置字体而转换不出来。...的功能,在转换后,我们可以进一步使用ITextSharp对pdf进行加工,比较常见的添加水印功能。...file=yourpdf.pdf 我们可以进一步修改viewer.html中的代码,根据需求去掉下载,打印等按钮,禁止用户下载和打印文件。

    3.7K10

    一些好用的开源控件

    大家还有什么好用的开源控件欢迎补充。 一、CKeditor 富文本编辑器       老版名称为fckeditor,相信大家耳熟能详。能够在页面上像word一样编辑文字效果。...配合Highlighter.Net工具可实现google那样的关键字的上下文提示,关键字可以高亮显示。也是一个java的移植项目,书写格式或者api都与java版相同。.../Files/lts8989/lucene.rar 官网地址:http://lucene.apache.org/ 五、PDFBox读取PDF文件       好多对pdf操作的工具都是创建pdf文件的,...读取pdf的工具有PDFBox和iTextSharp,有网友推荐使用iTextSharp,我在项目中使用的是PDFBox,个人感觉这个工具的效率很低。...PDFBox是一个将java源码编译成.net的dll文件的工具(看到此处的时候我也感到很神奇)。以下地址不太详细的介绍了PDFBox和iTextSharp的使用。

    1.6K60

    基于iTextSharp的PDF文档操作

    最近在和DHL物流公司(应该是个大公司)对接,取运单号的方式是调用对方提供的API,简单说,就是我们传一些发货地址和客户信息,要发的货物等,对方返回一个运单号和物流面单(就是我们淘宝快递上的面单)。...,DHL公司将物流面单以pdf文件流的形式返回,就是我们可以保存成Pdf文件,这样就容易处理的多,我们自己的拣货面单,如果也可以保存至Pdf文件,这样就可以将这2个Pdf文件一块打印出来,这算是一个折中的解决方案...技术点如下     1, 将DataTable导出至Pdf     2, DataTable中包含图片,也要能导出     3, Pdf类库,字体的引入(居然需要引用字体的绝对路径,想不通)   下面分别讲解...baseFont = iTextSharp.text.pdf.BaseFont.CreateFont(fontPath, iTextSharp.text.pdf.BaseFont.IDENTITY_H...前2联是DHL返回的Pdf文件,第3联是我本地生成的Pdf文件,合并成一个完整的发货面单 ?

    1.8K100

    WEB入门一 网页设计基础

    则可以使用如下方式链接 首页 3. 锚点 使用锚点可以在文档中设置标签,这些标签通常放在文档的特定主题处或顶部。...(1) 创建锚点 标签用于在HTML文档中创建一个锚点,属性name为命名锚点的名称 (2) 链接到命名锚点 链接到锚点需要使用标签分为两种情况...:链接到当前文档中的锚点、链接到其他文档中的锚点。...因为在超链接“查看 Chapter 4。”处设置了链接到锚点C4,所以当点击该超链接时,页面自动滚动到锚点C4处。...图1.1.20 锚点超链接用法 锚点连接用的比较多的是一些电子商务网站,由于商品比较多,用户拉滚动条一直向下浏览商品;到网页的最底部的时候怎么直接跳转到页面顶端呢?这时用锚点是一个省时省力的方法。

    7210

    Markdown的语法介绍+Typora的简单使用

    代码块 9.LaTeX数学公式 10.快捷键、语法汇总 11.锚点 12.技巧分享 前言 Markdown是一种可以使用普通文本编辑器编写的标记语言,通过简单的标记语法,它可以使普通文本内容具有一定的格式...Typora是一款轻便简洁的Markdown编辑器,支持即时渲染技术,这也是与其他Markdown编辑器最显著的区别即时渲染使得你写Markdown就想是写Word文档一样流畅自如,不像其他编辑器的有编辑栏和显示栏...,它还可以免费的导出成Html、PDF、Word等多种文件 1.标题用法(#号) 效果 实现 一级标题 # 一级标题 二级标题 ## 二级标题 三级标题 ### 三级标题 四级标题 #### 四级标题...利用Ctrl / 快捷键把源码模式打开,然后把#号删除即可 注意 ​ 在没有标题的文字中使用Ctrl += 快捷键则是默认H6(六级标题),而Ctrl - 则是没反应 2.文字格式 效果 实现 快捷键...11.锚点 网页中,锚点其实就是页内超链接,也就是链接本文档内部的某些元素,实现当前页面中的跳转。

    3.4K20

    【Java 进阶篇】HTML链接标签详解

    本篇博客将详细介绍HTML链接标签,包括超链接的类型、属性、用法和示例代码,旨在帮助基础小白更好地理解和使用链接标签。 1.... 标签的基本结构 标签是HTML中用来创建超链接的标签,其基本结构如下: 链接文本 href 属性:指定链接的目标地址,可以是其他网页的URL,也可以是同一页面内的锚点...(后文会详细介绍锚点)。...例如,链接到同一网站内的 About 页面: 关于我们 3.2.2. 锚点 在同一页面内创建锚点链接,使用户可以快速跳转到页面内的不同位置。... 然后,通过 href 属性指定锚点的名称来创建链接: 跳转到第一部分 3.3. 下载链接 下载链接用于提供文件下载,例如PDF、图片、文档等。

    42430

    WEB入门一 网页设计基础

    则可以使用如下方式链接 首页 ​3. 锚点​ 使用锚点可以在文档中设置标签,这些标签通常放在文档的特定主题处或顶部。...(1) 创建锚点 标签用于在HTML文档中创建一个锚点,属性name为命名锚点的名称 (2) 链接到命名锚点 链接到锚点需要使用标签分为两种情况...:链接到当前文档中的锚点、链接到其他文档中的锚点。...因为在超链接“查看 Chapter 4。”处设置了链接到锚点C4,所以当点击该超链接时,页面自动滚动到锚点C4处。...图1.1.20 锚点超链接用法 锚点连接用的比较多的是一些电子商务网站,由于商品比较多,用户拉滚动条一直向下浏览商品;到网页的最底部的时候怎么直接跳转到页面顶端呢?这时用锚点是一个省时省力的方法。

    18510

    HTML常用文本标记,超级链接和路径描述

    预格式化文本,按照编辑器里的文本样式、字体大小、字体颜色,直接在网页上显示,示例: ? 运行结果: ?...标记也是删除线,不过里能使用一些属性,例如常用的cite和datetime,前者用于指定删除原因,后者用于指定删除时间,示例: ? 运行结果: ?...上面所介绍的路径描述在超级链接里会应用到,当需要使用超级链接来链接工程下的某个html文件时可以使用相对路径和绝对路径,但是尽量使用相对路径。...运行结果,当鼠标移动到这个超链接的时候就会显示title的内容:锚点名称”> 文本 ? 锚点: 锚点是网页制作中超级链接的一种,又叫命名锚记。...同样的可以跳转到另一个网页中的锚点,示例: ? 运行结果: ? ?

    1.9K20

    开源免费且稳定实用的.NET PDF打印组件itextSharp(.NET组件介绍之八)

    对于项目开发中使用到打印的地方会非常多,在.NET项目中,选择打印的方式比较多,例如原始的IE网页打印、水晶报表、JS插件实现打印、导出文档打印,以及今天提到的使用itextSharp组件实现PDF打印等等...一.itextSharp组件概述:          1.iText的是PDF库,它允许你创建,调整,检查和维护的可移植文档格式文件(PDF):         (1).基于从XML文件或数据库中的数据生成文件和报告...iText所使用的的Java,.NET,Android和GAE开发人员加强与PDF功能的应用程序。iTextSharp的是.NET端口。    ...以上是对itextSharp组件的一些特性的简单介绍,如果需要更加深入的了解itextSharp组件的相关信息,可以细致的查看API文档和itextSharp产品介绍。...组件介绍之七)    口碑和性能都高的.NET PDF打印组件itextSharp(.NET组件介绍之八)

    7.8K50

    使用 iTextSharp VS ComPDFKit 在 C# 中从 PDF 中提取文本

    对于开发人员来说,从 PDF 中提取文本是有效数据提取的第一步。你们中的一些人可能会担心如何使用 C# 从 PDF 中提取文本。iTextSharp 一直是 PDF 文本提取的有效解决方案。...在本指南中,我们将深入研究如何使用 iTextSharp 在 C# 中进行 PDF 文本提取,涵盖从安装和项目设置到提供代码示例的所有内容。...使用 iTextSharp 进行文本提取的步骤与 ComPDFKit 类似。安装 iTextSharp PDF 库并创建项目后。...使用 iTextSharp,开发人员需要编写自定义代码或逻辑来实现所需的功能,这需要对库和 C# 有深入的了解。...因此,在ComPDFKit与iTextSharp在PDF文本提取准确率相近的前提下,ComPDFKit在性能和代码可读性方面更胜一筹。

    14910
    领券