Giter VIP home page Giter VIP logo

pdftoprinter's People

Contributors

lwestfall avatar s-vishnevsky avatar svishnevsky 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  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  avatar

pdftoprinter's Issues

The system cannot find the file specefied

@svishnevsky i am using PDFtoPrinter v1.5.0 in my UWP application and it throws the error: The system cannot find the file specified.
at first i suspected that it may be because UWP doesn't have full access to the file system and i placed my pdf file in UWP LocalState folder which by default UWP application has access to, but still it throws the same error. since it prints using path, i am unable to provide the file.

Here is my piece of code for printing PDF file:

public async Task PrintPDF()
{
StorageFolder temp = ApplicationData.Current.TemporaryFolder;
string printerName = "EPOS8080";
string filePath = temp + "\report.pdf";
var printer = new PDFtoPrinterPrinter();
await printer.Print(new PrintingOptions(printerName, filePath));
return filePath;
}

打印不同文件且不同份数 请问如何实现

要打印多个 PDF 文件:在命令行中指定通配符(例如 A*.pdf);该命令默认递归搜索子目录。您还可以在指定单个文件名时使用/r开关,或/Rn来递归n 个深度的子目录。

-以上是关于PDFtoPrinter命令行程序关于打印多个PDF文件的说明文档。
-文档中未指出不同名称PDF的参数写法。
-想要打印一个文件夹指定的多个不同名称的PDF文件参数应该怎么写?

尝试过如下命令均未成功。有的只能识别第一个pdf,有的直接报错。
PDFtoPrinter "管理经济学.pdf" "最优化笔记.pdf"
PDFtoPrinter "管理经济学.pdf","最优化笔记.pdf"
PDFtoPrinter 管理经济学.pdf 最优化笔记.pdf
PDFtoPrinter 管理经济学.pdf,最优化笔记.pdf

The system cannot find the file specified

Hi, I tried this package in a console project, everything works great but now I use it in a WPF project and I get this error :

image

image
This code work in a console project so why not in WPF ? (The file exist in the default path)

focus parameter

Hi! The parameter focus d't work under Windows 11. We try to adapt the very good Soft to FRITZFax in Germany....
The window caption "FRITZ!fax - " will be not recognized.

Is this working on windows service

Hi !

I installed PDFtoPrinter on my windows service project.
It is not working ... Printer didn't receive any pdf file.
But working fine with Console app.

Windows form only ?? Or any suggestions ?? thank you.

Not Disposing

Hi,
Am using this implementation in a Windows Service and am having issues that the PDFToPrint executable is not being removed from memory. When looking at Task Manager I can see up to 20 instances of the PDFToPrint executable.

Regards.
Peter

Suggestion: Print PDF from a stream

Can there be an option to print from a stream?

I would like to download a pdf file and store it in a variable as a stream and print it.

Thanks in advance.

use `<PublishSingleFile>true</PublishSingleFile>` not found directory name.

It works fine when I debug it, but when I publish it and run it, it doesn't work.

As far as I can see the source, here I am getting DirectoryName from Location

return Path.Combine(
Path.GetDirectoryName(
(Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly()).Location),
utilName);

Shouldn't it fall back to AppContext.BaseDirectory if the Location return value is an empty string?

see dotnet/corert#5467

sample project: https://github.com/juner/PdfToPrinterNotWorkSample_20230214

When doing a publish the PDFtoPrinter.exe is not copied

Hi,

I had an issue when doing a publish (with .Net Core 3.1.5) that the PDFtoPrinter.exe was not present in the published folder. I solved it by adding the following to my csproj.

<Target Name="CopyPDFtoPrinterExe" AfterTargets="Publish">
    <Copy SourceFiles="$(OutDir)\PDFtoPrinter.exe" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" />
</Target>

But maybe it can also be added to the PDFtoPrinter.targets.

I'm not sure if it would help, but I hope so.

Kind regards,

Jochen

.net 5 support without -windows

When upgrading to version 1.4.0 I suddenly got build errors saying I need to the target framework to net5.0-windows. But in my case I reference PdfToPrinter in an assembly that is not an exe. That assembly also has some code that can run on all platforms.

My exe assembly that actually executes PdfToPrinter has net5.0-windows as target framework.

The question is can the net5.0-windows target framework in the code of PdfToPrinter be changed to net5.0?

File not found when printing from web service

I am trying to print from a .NET web service. The exception being thrown is "The system cannot find the file specified". I assume that means the pdf itself, but the file does exist. System.IO.File.Exists(mypdffile) run during debug returns true. The service is running in Visual Studio 2013 framework 4.7 on my local box on which I am an admin. If I use the same code in a console app it works fine. The PDFtoPrinter.dll and PDFtoPrinter.exe are in the project's bin folder.

var wrapper = new PDFtoPrinterPrinter();
                await wrapper
                    .Print(new PrintingOptions(
                        printer, filePath)
                        );

Update: I noticed a closed post where someone was having the same issue but in a WPF project. A recommendation was to install using Nuget rather than manually (even though that works in a console app). Unfortunately, the install fails and is rolled back:

image

Thanks for any help.

Network printer not working

I am trying to print to a network printer using the syntax \\servername\printername and it's not working. No errors from the library and nothing ends up in the print queue. Local printers work fine.

File structure changes when publishing

Hello! I have come across a problem I've tried to fix to avail. I have a project with your nuget, and when built, copies it's executable to the root of the project, which is the expected behavior, but when published, the executable is moved to a newly created file structure "packages/PDFtoPrinter.1.5.0/build". I've found no way to override this behavior, so that the executable is placed at the root of the project.
As I have multiple other nugets installed, and none display this issue, I believe it might be a problem with this specific nuget, but would like some confirmation, and if so, what alternatives could be achieved to get working functionality when published.

CleanupFilesPrinter not removing files

CleanupFilesPrinter does not delete files after printing. The files are on my local PC and print successfully. I have administrative rights on the box.

Issue with printing with concurrency that one of the files stays with PDF XChange Viewer open blocking

Hi,

I am using your nuget to print PDF to a printer with concurrency, and when i send to print 3 or 4 pdfs to printers, randomly one of them stays with the PDF XChange Viewer app open hanging and blocking the print.
Once i close the xchange viewer it prints the pdf.

I am doing what your samples show, creating the print for each file and waiting for the tasks at the end.

`var wrapper = new PDFtoPrinterPrinter(5);

var taskList = new List();
taskList.Add(wrapper.Print(new PrintingOptions(printerName, fileToPrint + "_1.pdf")));
taskList.Add(wrapper.Print(new PrintingOptions(printerName, fileToPrint + "_2.pdf")));
taskList.Add(wrapper.Print(new PrintingOptions(printerName, fileToPrint + "_3.pdf")));

Task.WaitAll(taskList.ToArray());`

Can you help me, of what i'm doing wrong?

Very thanks.

Support for .Net Standard 2.0

I have a .Net Core project and would like to use this library, but I've seen only full framework is supported.

The reason is probably the reference to System.Printing, but I've seen this is only used in the CleanupFilesPrinter.

Are you open for a .net standard compatible version, without support for CleanupFilesPrinter?

PdfToPrint.exe is missing

Hey there!
First of, thanks for this useful project!

I had an error today which I finally figured out.
I have your nuget package installed within a .net5.0-windows library. This library is referenced as project reference in another project.
This result in an error when I try to print any pdf because PdfToPrint.exe is not included in the project which references my own library which references your nuget package. I still have the file PdfToPrint.dll but no exe file.

What I need to do is to install the package in my other project as well in order to get it working.

Is there any easy solution to automatically add the nuget reference when it's inside another library which is referenced by another project?

Get PDFtoPrinter to ignore embedded Javascript

Hi,

while using PDFtoPrinter in my windows service, I realized that embedded javascript in pdf-files is executed upon printing. Some of the files I need to print contain js code, which causes the PDFXCview process to not terminate itself after printing and therefore lock the file.
Is there a way for the Print()-Method to ignore embedded javascript?
I work around this problem by killing the process manually by name after every print, which is not a problem because I print the files one at a time. However, this might change in the future so a way to ignore embedded js would be appreciated.

Kind regards

Resize PDF

Add a way to resize each page in the PDF to a standard page size.

PDFtoPrinter is updated

Just for your information: I've updated the PDFtoPrinter utility to make it a bit more reliable and to add some new options.

One feature not yet documented: if you add the command-line switch

focus="Window Title"

the program will return keyboard focus to the window with the title in the parameter. Partial titles will work; you do not need the full title.

We Can Print Silent

Dear svishnevsky,
We can export silent not show dialog pdf with path setting from xml ?

Multi Printer

Hello
I want to throw files to several printers at the same time with "BackgroundWorker" in C#.
But I am getting the error in the picture.
I request your support

hatapdf özel

where is this exe from ?

Hi ! This is good pdf print tool.

ButI don't understand PDFtoPrinter.exe is this 3rd party tool ??
Is it commercial tool ??
Thank you.

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.