• 大小: 26.61MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-13
  • 语言: C#
  • 标签: C#  pdf  

资源简介

把html文档直接生成pdf,不需要在服务器安装软件,可以在iis使用。

资源截图

代码片段和文件信息

using System;
using System.Drawing.Printing;
using System.Globalization;
using System.Threading;
using Common.Logging;

namespace Pechkin
{
    /// 
    /// Global configuration object. Is used to create converter objects.
    /// 
    /// It uses fluid notation to change its fields.
    /// 

    public class GlobalConfig
    {
        private string _paperSize = “A4“;
        private string _paperWidth; // for example “4cm“
        private string _paperHeight; // or “12in“
        private string _paperOrientation = “Portrait“; // must be either “Landscape“ or “Portrait“

        private string _colorMode = “Color“; // must be either “Color“ or “Grayscale“
        private string _resolution; // deprecated has no effect
        private string _dpi; // DPI used when printing like “80“

        private string _pageOffset; // start page number (used in headers footers and TOC)
        private string _copies; // number of copies to include into the document =)
        private string _collate = “false“; // collate copies or not must be either “true“ or “false“

        private string _outline = “false“; // generate table of contents must be either “true“ or “false“
        private string _outlineDepth = “4“; // outline depth
        private string _dumpOutline = ““; // filename to dump outline in xml format

        private string _output = ““; // filename to dump PDF into if “-“ then it‘s dumped into stdout
        private string _documenttitle; // title for the PDF document

        private string _useCompression = “true“; // turns on lossless compression of the PDF file

        private string _marginTop; // size of the top margin (ex. “2cm)
        private string _marginRight;
        private string _marginBottom;
        private string _marginLeft;

        private string _outputFormat = “pdf“; // can be “ps“ or “pdf“

        private string _imageDpi; // maximum DPI for the images in document
        private string _imageQuality; // specifies JPEG compression factor for the (reencoded) images in pdf from “0“ to “100“

        private string _cookieJar; // path to (text) file used to load and store cookies

        [Obsolete(“Setting paper size by name doesn‘t work in the lib. Use the overload that takes PaperKind instead.“)]
        public GlobalConfig SetPaperSize(string sizeName)
        {
            _paperSize = sizeName;

            _paperHeight = ““;
            _paperWidth = ““;

            return this;
        }
        public GlobalConfig SetPaperSize(PaperKind kind)
        {
            // don‘t work
            //return SetPaperSize(Enum.GetName(typeof(PaperKind) kind));

            if (PechkinStatic.PaperSizes.ContainsKey(kind))
            {
                PechkinStatic.StrPaperSize ps = PechkinStatic.PaperSizes[kind];

                return SetPaperSize(ps.Width ps.Height);
            }

            LogManager.GetCurrentClassLo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-11-22 09:57  Pechkin-master\
     文件         146  2013-11-22 09:57  Pechkin-master\.gitignore
     目录           0  2013-11-22 09:57  Pechkin-master\.nuget\
     文件         169  2013-11-22 09:57  Pechkin-master\.nuget\NuGet.Config
     文件        6698  2013-11-22 09:57  Pechkin-master\.nuget\NuGet.targets
     文件      619520  2013-11-22 09:57  Pechkin-master\.nuget\nuget.exe
     文件        3080  2013-11-22 09:57  Pechkin-master\Pechkin.sln
     目录           0  2013-11-22 09:57  Pechkin-master\Pechkin\
     目录           0  2013-11-22 09:57  Pechkin-master\Pechkin\EventHandlers\
     文件         131  2013-11-22 09:57  Pechkin-master\Pechkin\EventHandlers\BeginEventHandler.cs
     文件         125  2013-11-22 09:57  Pechkin-master\Pechkin\EventHandlers\ErrorEventHandler.cs
     文件         122  2013-11-22 09:57  Pechkin-master\Pechkin\EventHandlers\FinishEventHandler.cs
     文件          89  2013-11-22 09:57  Pechkin-master\Pechkin\EventHandlers\LibDeInitEventHandler.cs
     文件          87  2013-11-22 09:57  Pechkin-master\Pechkin\EventHandlers\LibInitEventHandler.cs
     文件         156  2013-11-22 09:57  Pechkin-master\Pechkin\EventHandlers\PhaseChangedEventHandler.cs
     文件         159  2013-11-22 09:57  Pechkin-master\Pechkin\EventHandlers\ProgressChangedEventHandler.cs
     文件         129  2013-11-22 09:57  Pechkin-master\Pechkin\EventHandlers\WarningEventHandler.cs
     文件       16000  2013-11-22 09:57  Pechkin-master\Pechkin\GlobalConfig.cs
     文件        4807  2013-11-22 09:57  Pechkin-master\Pechkin\IPechkin.cs
     文件       36617  2013-11-22 09:57  Pechkin-master\Pechkin\objectConfig.cs
     文件    16773780  2013-11-22 09:57  Pechkin-master\Pechkin\Pechkin.0.5.8.1.nupkg
     文件        5644  2013-11-22 09:57  Pechkin-master\Pechkin\Pechkin.csproj
     文件        1043  2013-11-22 09:57  Pechkin-master\Pechkin\Pechkin.nuspec
     文件        6621  2013-11-22 09:57  Pechkin-master\Pechkin\PechkinBindings.cs
     文件       23517  2013-11-22 09:57  Pechkin-master\Pechkin\PechkinStatic.cs
     目录           0  2013-11-22 09:57  Pechkin-master\Pechkin\Properties\
     文件        1526  2013-11-22 09:57  Pechkin-master\Pechkin\Properties\AssemblyInfo.cs
     目录           0  2013-11-22 09:57  Pechkin-master\Pechkin\Reference\
     目录           0  2013-11-22 09:57  Pechkin-master\Pechkin\Reference\include\
     文件        1928  2013-11-22 09:57  Pechkin-master\Pechkin\Reference\include\converter.hh
     文件        1475  2013-11-22 09:57  Pechkin-master\Pechkin\Reference\include\dllbegin.inc
............此处省略158个文件信息

评论

共有 条评论