Code Monkey home page Code Monkey logo

pdfiumprinter's People

Contributors

gihansoft avatar leandrosilva avatar sandrohanea avatar waven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pdfiumprinter's Issues

How to set the pages to be printed

I see you can set the PrintRange to be selection, but where can you specify the selection of pages to be printed?

I can only find From Page and To Page, but what if I want to print 1, 4, 9, 12 for example.

Thanks!

Cannot print when target runtime is set manually

When you want to publish and set the set runtime manually to win-x64 it looks for the runtime folder (runtimes\win-x64\native), but that folder doesn't exist when you publish as self contained.

When selfcontained the file will end up in the root directory.

Edit: Solved it by copying the windows library as Custom and added a new override:

string newPath = fileName;
if (!File.Exists(newPath))
{
    newPath = Environment.CurrentDirectory + "\\pdfium.dll";
}

最新1.4.1版本在.NET Framework中加载pdfium.dll的路径不对

在64系统中使用anycpu且勾选首选32位或者x86编译时,
查找的是“.../x64/pdfium.dll”与实际编程程序版本不一致导致无法加载
查看源代码发现是因为使用RuntimeInformation.OSArchitecture判断的问题,
这个是用来判断系统的不是用来判断实际运行的程序,
要判断运行程序应该使用RuntimeInformation.ProcessArchitecture、Environment.Is64BitProcess、IntPtr.Size吧?

.NET Framework下FPDF_LoadCustomDocument报错

异常:托管调试助手 "PInvokeStackImbalance":“对 PInvoke 函数“PdfiumPrinter!PdfiumPrinter.NativeMethods+Imports::FPDF_LoadCustomDocument”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。”

使用的是bblanchon.PDFiumV8.Win32 123.0.6309
建议[DllImport("pdfium")]=>[DllImport("pdfium", CallingConvention = CallingConvention.Cdecl)]

NetFramework exception during library load

Latest version (1.4.0) is failing if netframework is used using: Verify you have have included the native Pdfium library in your application, or install the default libraries with the bblachon.PDFium Nuget.

Even if you install the package, the library cannot find the native dlls as the path where they are copied is different on netframework.

Unable to run in .NET Framework 4.6.1

Running Error: System.IO.FileNotFoundException: 未能加载文件或程序集“System.Runtime.InteropServices.RuntimeInformation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件

Windows 7 SP1 Running Error

When I package it as a DLL and provide it to Electron for execution on Windows 7,,error message :System.IO.FileNotFoundException: 未能加载文件或程序集“System.Runtime.InteropServices.RuntimeInformation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件。

Can not print with signature

thank you for sharing. The solution works fine. I have a pdf file with a digital signature, after printing it does not show this digital signature, do you have a solution?

How to set the printing paper size

image
The printed paper seems to be A4, how do I set the paper size?
This is my code, I have set the size of the PDF, but it will not affect the paper size.

`var printerName = "pdfFactory Pro";

var printFile = "D:\MyProject\Electron\electron-print\PDF\test04.pdf";

var pdfDocument = PdfDocument.Load(printFile);

var printDocument = pdfDocument.CreatePrintDocument();

var s = printDocument.PrinterSettings = new PrinterSettings()
{
PrinterName = printerName
};

double pdfWidth = 40 / (25.4 / 100);
double pdfHeight = 30 / (25.4 / 100);
printDocument.DefaultPageSettings = new PageSettings()
{
Margins = new Margins(0, 0, 0, 0),
PaperSize = new PaperSize("size", (int)pdfWidth, (int)pdfHeight)
};

PaperSize updatedPaperSize = s.DefaultPageSettings.PaperSize;
Console.WriteLine(updatedPaperSize.Height);
printDocument.PrintController = new StandardPrintController();
printDocument.Print();`

I tried using PrinterSettings.PaperSizes sets the size of the printed paper, but this property is read-only and I cannot set it.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.