code/Athena0.0.1/common/Util/File/Pdf/PDFOperation.cs

(开头部分) 13KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
using System;
using System.Web;
using System.Data;

namespace Athena.common.Util
{
    /// <summary>
    ///项目名称:腾杰超轻量级开发框架
    ///开发者:张梦丽
    ///模块名称和描述:PDF文档操作类
    ///最后更新时间:2017/4/6
    ///日志说明:我把open方法的文件路径生成放到里面了,加了pdf生成方法
    /// </summary>

    //------------------------------------调用--------------------------------------------
    //PDFOperation pdf = new PDFOperation();
    //pdf.Open(new FileStream(path, FileMode.Create));
    //pdf.SetBaseFont(@"C:\Windows\Fonts\SIMHEI.TTF");
    //pdf.AddParagraph("测试文档(生成时间:" + DateTime.Now + ")", 15, 1, 20, 0, 0);
    //pdf.Close();
    //-------------------------------------------------------------------------------------
    public class PDFOperation
    {
        #region 构造函数
        /// <summary>
        /// 构造函数
        /// </summary>
        public PDFOperation()
        {
            rect = PageSize.A4;
            document = new Document(rect);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="type">页面大小(如"A4")</param>
        public PDFOperation(string type)
        {
            SetPageSize(type);
            
            document = new Document(rect);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="type">页面大小(如"A4")</param>
        /// <param name="marginLeft">内容距左边框距离</param>
        /// <param name="marginRight">内容距右边框距离</param>
        /// <param name="marginTop">内容距上边框距离</param>
        /// <param name="marginBottom">内容距下边框距离</param>
        public PDFOperation(string type, float marginLeft, float marginRight, float marginTop, float marginBottom)
        {
            SetPageSize(type);
            document = new Document(rect, marginLeft, marginRight, marginTop, marginBottom);
        }
后面还有 321 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。