资源简介

O2S.Components.PDFRender4NET破解版打印pdf,无水印,c#源码

资源截图

代码片段和文件信息

using O2S.Components.PDFRender4NET;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WinPdf_O2S
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender EventArgs e)
        {
            printShow(“0.pdf“);
        }
        private int printShow(string url)
        {
            int isOK = 0;
            PDFFile file = PDFFile.Open(url);
            PrinterSettings settings = new PrinterSettings();
            System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();
            //settings.PrinterName = “hp LaserJet 1160 PCL 5e“;
            settings.PrintToFile = false;

            //设置纸张大小(可以不设置,取默认设置)3.90 in  8.65 in
            PaperSize ps = new PaperSize(“test“ 4 9);
            ps.RawKind = 9; //如果是自定义纸张,就要大于118,(A4值为9,详细纸张类型与值的对照请看http://msdn.microsoft.com/zh-tw/library/system.drawing.printing.papersize.rawkind(v=vs.85).aspx)

            O2S.Components.PDFRender4NET.Printing.PDFPrintSettings pdfPrintSettings = new O2S.Components.PDFRender4NET.Printing.PDFPrintSettings(settings);
            pdfPrintSettings.PaperSize = ps;
            pdfPrintSettings.PageScaling = O2S.Components.PDFRender4NET.Printing.PageScaling.FitToPrinterMarginsProportional;
            pdfPrintSettings.PrinterSettings.Copies = 1;

            try
            {
                file.Print(pdfPrintSettings);
                isOK = 1;
            }
            catch (Exception)
            {
                isOK = -1;
                throw;
            }
            finally
            {

                file.Dispose();
            }
            return isOK;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     396686  2018-01-03 10:31  WinPdf_O2S\bin\Release\0.pdf

     文件     369382  2018-11-19 10:12  WinPdf_O2S\bin\Release\1.pdf

     文件     745472  2018-04-08 19:16  WinPdf_O2S\bin\Release\O2S.Components.PDFRender4NET.dll

     文件    2092032  2016-08-08 23:02  WinPdf_O2S\bin\Release\O2S.Components.PDFView4NET.dll

     文件       8704  2018-11-19 10:12  WinPdf_O2S\bin\Release\WinPdf_O2S.exe

     文件      19968  2018-11-19 10:12  WinPdf_O2S\bin\Release\WinPdf_O2S.pdb

     文件      24224  2018-11-19 10:10  WinPdf_O2S\bin\Release\WinPdf_O2S.vshost.exe

     文件        490  2018-04-12 07:35  WinPdf_O2S\bin\Release\WinPdf_O2S.vshost.exe.manifest

     文件       2077  2018-11-19 10:12  WinPdf_O2S\Form1.cs

     文件       2022  2018-11-19 10:12  WinPdf_O2S\Form1.Designer.cs

     文件       5817  2018-11-19 10:12  WinPdf_O2S\Form1.resx

     文件       6866  2018-11-19 10:05  WinPdf_O2S\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       7087  2018-11-19 10:11  WinPdf_O2S\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache

     文件        802  2018-11-19 10:12  WinPdf_O2S\obj\Release\WinPdf_O2S.csproj.FileListAbsolute.txt

     文件        977  2018-11-19 10:12  WinPdf_O2S\obj\Release\WinPdf_O2S.csproj.GenerateResource.Cache

     文件      12415  2018-11-19 10:12  WinPdf_O2S\obj\Release\WinPdf_O2S.csprojResolveAssemblyReference.cache

     文件       8704  2018-11-19 10:12  WinPdf_O2S\obj\Release\WinPdf_O2S.exe

     文件        180  2018-11-19 10:12  WinPdf_O2S\obj\Release\WinPdf_O2S.Form1.resources

     文件      19968  2018-11-19 10:12  WinPdf_O2S\obj\Release\WinPdf_O2S.pdb

     文件        180  2018-11-19 10:12  WinPdf_O2S\obj\Release\WinPdf_O2S.Properties.Resources.resources

     文件        491  2018-11-19 10:05  WinPdf_O2S\Program.cs

     文件       1344  2018-11-19 10:04  WinPdf_O2S\Properties\AssemblyInfo.cs

     文件       2872  2018-11-19 10:04  WinPdf_O2S\Properties\Resources.Designer.cs

     文件       5612  2018-11-19 10:04  WinPdf_O2S\Properties\Resources.resx

     文件       1097  2018-11-19 10:05  WinPdf_O2S\Properties\Settings.Designer.cs

     文件        249  2018-11-19 10:04  WinPdf_O2S\Properties\Settings.settings

     文件       4274  2018-11-19 10:12  WinPdf_O2S\WinPdf_O2S.csproj

     目录          0  2018-11-19 10:05  WinPdf_O2S\obj\Debug\TempPE

     目录          0  2018-11-19 10:05  WinPdf_O2S\obj\Release\TempPE

     目录          0  2018-11-19 10:04  WinPdf_O2S\bin\Debug

............此处省略10个文件信息

评论

共有 条评论