sandrohanea / pdfiumprinter Goto Github PK
View Code? Open in Web Editor NEWOpen-Source PdfiumPrinter
License: Apache License 2.0
Open-Source PdfiumPrinter
License: Apache License 2.0
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!
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";
}
在64系统中使用anycpu且勾选首选32位或者x86编译时,
查找的是“.../x64/pdfium.dll”与实际编程程序版本不一致导致无法加载
查看源代码发现是因为使用RuntimeInformation.OSArchitecture判断的问题,
这个是用来判断系统的不是用来判断实际运行的程序,
要判断运行程序应该使用RuntimeInformation.ProcessArchitecture、Environment.Is64BitProcess、IntPtr.Size吧?
异常:托管调试助手 "PInvokeStackImbalance":“对 PInvoke 函数“PdfiumPrinter!PdfiumPrinter.NativeMethods+Imports::FPDF_LoadCustomDocument”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。”
使用的是bblanchon.PDFiumV8.Win32 123.0.6309
建议[DllImport("pdfium")]=>[DllImport("pdfium", CallingConvention = CallingConvention.Cdecl)]
Print settings are read-only, I need to define paper
On a stylus printer, there are often different paper types that need to be specified when printing
thinks
Hello,
I am using PdfiumPrinter in .NET framework but can not find a way to set the name of printjob. It is always listed as "document".
Can we set it on forehand?
Willem Luijk
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.
Running Error: System.IO.FileNotFoundException: 未能加载文件或程序集“System.Runtime.InteropServices.RuntimeInformation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。系统找不到指定的文件
I haave pdf file but the language is multiple language.
Is this support each language .. zh-cn , zh-tw ???
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”或它的某一个依赖项。系统找不到指定的文件。
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.