stchan / pdfscribe Goto Github PK
View Code? Open in Web Editor NEWA PDF virtual printer for 64-bit Windows / .NET 4.8 or later
License: GNU Affero General Public License v3.0
A PDF virtual printer for 64-bit Windows / .NET 4.8 or later
License: GNU Affero General Public License v3.0
I'm looking for a way to make some custom paper size that user can select on printer properties like another printer does. Is there anyway I can make it true? Thanks for spending time for my question!
When I try to build the solution, I don't understand how to build PdfScribeInstall to get final installer file. After building the PdfScribeInstall\bin\Debug folder is empty, and I get the following message in the Output:
Skipped Build: Project: PdfScribeInstall, Configuration: Debug x64 ------
3>Project not selected to build for this solution configuration
Thanks in advance.
Hello,
I would like to suggest that the printer take by default (when possible) the name of the file or the tittle that you want to print.
Congratulations, great virtual printer and gread job. thanks!
Greetings.
Hello.
Is there a way to have my name as "Author's name" within the created pdf file?
Using v1.3.2.30119 installed from MSI. Default configuration.
When printing a Word .docx file thru PdfScribe, even though the "Save as type" is .pdf, the output file name still ends in .docx.
This results in an output file of type "pdf" but an extension of "docx". Which fails to open correctly.
The expected behavior would be for the output file extension ".pdf" to match the file type "pdf".
Dear Stchan ,
When i print PDF, it not starting with services Print Spooler, how to we can fix problem this in windows 10, if you have any solution or any suggest for me , please help, thank you.I have try with PDF24 and PDF Creator, it working normal.
Image describe :
If i fix by step use troubleshoot, it worked
Port Working
With start first computer, it not working and can't seach port to print.
First off, great project. I was looking everywhere for a viable virtual PDF printer.
During my research, I read comments that said using C# / .NET would slow down or use too many resources for printing / PDF creation compared to C++. Is this true for this project?
Thanks for this bloat free nice and simple PDF printer driver. It's exactly what I was looking for. The only thing I miss is an option to automatically open the PDF once it's been written. Would you be able to add this?
side note: the driver is able to print other page sizes than letter (which is stated in your readme here on Github). I at least have no issues with printing documents in the German A4 size correctly.
First of all Great Project.... Thanks..
I want to get page range when user did print... like number page he selected... please help
I want to debug this project and want to add little bit customization for me can you guide me to debug this project
Please assist how to build project and use it
Hi,
I really appreciated for what you have done for this project. That helps me a lot for my currently project. But, now I'm facing a challenge with the 32bit processor because the dll which included in this project is not supported for 32bit.
Is there any way I can change the project to supports 32bit processor?
Huge thanks.
Hello,
Very helpful project. Thanks a lot for developing and sharing it.
Context :
I found this bug :
How to replicate :
facture_échantillons.pdf
Observed result :
facture_
Hi,
Thanks for such a helpful project.
I would like to inform about an issue.
Scenario 1: The input PDF file with default page size i.e. A4. The generated output PDF file also contains identical pages i.e. A4.
Scenario 2: The input PDF file with custom page size i.e. epos bill receipt (height-width ratio is quite high). The generated output PDF file contains 90deg anticlockwise rotated pages. However, the inverted height-width ratio is the same as the original. So, the pages are only rotated after generation.
Consideration: During a print, I have ticked the 'Choose paper source by PDF size' option.
Kindly address the said issue.
Thanks
Hi,
Really appreciated for what you have provided here with this awesome project. I have a question regarding to the print job in program.cs file. In my project, I need to handle for some case that does not required to convert to PDF. Therefore, the inputted document should directly forward to printer. Is it possible here to do so in this project?
Thank you so much!
Hi,
Please walk me through or give brief overview of different projects as part of PdfScribe and how Ghostscript and Redmon in conjunction with PdfScribe works to deliver pdf files.
Can there be any custom header and footer to be added to the content being sent to the virtual driver?
Or can we modify the content before printing?
If so, then this would be great feature to be added to this software.
dot not want wix install ,just exe file to install pdfscribe sothat we can bulk install 100 PC
Hi,
I am using your source code from version 1.0.5 this time but I still get an exception on line 172 in Program.cs
using (SaveFileDialog pdfFilenameDialog = new SaveFileDialog())
{
pdfFilenameDialog.AddExtension = true;
pdfFilenameDialog.AutoUpgradeEnabled = true;
pdfFilenameDialog.CheckPathExists = true;
pdfFilenameDialog.Filter = "pdf files (*.pdf)|*.pdf";
pdfFilenameDialog.ShowHelp = false;
pdfFilenameDialog.Title = "PDF Scribe - Set output filename";
pdfFilenameDialog.ValidateNames = true;
if (pdfFilenameDialog.ShowDialog(dialogOwner) == DialogResult.OK)
The stack trace is
Exception Info: System.InvalidOperationException
at System.Windows.Forms.CommonDialog.ShowDialog(System.Windows.Forms.IWin32Window)
at PdfScribe.Program.GetPdfOutputFilename(System.String ByRef)
at PdfScribe.Program.Main(System.String[])
There is no error in the UI but I never receive a prompt to the save dialog to save the pdf. This is with both the installer provided in the release and by building the project myself. In Windows 7 I get the prompt to the save dialog.
Dear Stchan,
how to stay the fonts when i print a pdf to pdf by pdfscribe?
I really appreciate your answering my question
Hi, stchan,
The pdfscribe.exe read the console stream to a temp file. Is there any way to get the original file information? like title, etc..
Thanks!
Hi,
Thanks for all your support, I'm almost completed my app but there are still a minor problem that app always open the pdf reader automatically whenever it's running.
The reason is because of the ghostscript execution. But, is there anyway prevent this from open the pdf reader?
Thanks again!
Hi,
After pdf generation by ghostscript method (GhostScript64.CallAPI(ghostScriptArguments)
I'm trying to open pdf using iTextSharp library to read as text but exception is occurring which is caught under catch (IOException ioEx).
Below is my sample code snippet
GhostScript64.CallAPI(ghostScriptArguments);
DisplayPdf(outputFilename);
String pdfContent = ReadPDF(outputFilename);
...
static String ReadPDF(String outputFilename)
{
StringBuilder text = new StringBuilder();
using (PdfReader reader = new PdfReader(outputFilename))
{
for (int i = 1; i <= reader.NumberOfPages; i++)
{
text.Append(PdfTextExtractor.GetTextFromPage(reader, i));
}
reader.Close();
}
return text.ToString();
}
Hi Sherman,
First of all thank you for the great project.
Just I want to know that is it prossible to get orginal file name with pdf extension?
for example: Book1.xlsx to Book1.PDF
Regards
The PdfScribe.exe.config
is that:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="PdfScribe.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="PdfScribe"
switchName="PdfScribeAll" >
<listeners>
<add name="textwriterListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="PdfScribe_trace.log"
traceOutputOptions="DateTime" />
<remove name="Default" />
<clear /> <!-- Remove the <clear /> element to turn on tracing output -->
</listeners>
</source>
</sources>
<switches>
<add name="PdfScribeAll" value="Verbose"/>
</switches>
</system.diagnostics>
<applicationSettings>
<PdfScribe.Properties.Settings>
<setting name="OutputFile" serializeAs="String">
<value>C:\Temp\TEMP_%RAND%.PDF</value>
</setting>
<setting name="AskUserForOutputFilename" serializeAs="String">
<value>False</value>
</setting>
<setting name="OpenAfterCreating" serializeAs="String">
<value>True</value>
</setting>
</PdfScribe.Properties.Settings>
</applicationSettings>
</configuration>
The environment variable RAND
is my custom system environment variable. It does not contain any illegal characters, but PdfScribe couldn't save the PDF and threw out an error called -100.
`String[] ghostScriptArguments =
{
"-dBATCH",
"-dNOPAUSE",
"-dSAFER",
"-sDEVICE=pdfwrite",
String.Format("-sOutputFile={0}", outputFilename),
standardInputFilename,
"-c",
@"[/Creator(PdfScribe 1.0.7 (PSCRIPT5)) /DOCINFO pdfmark",
"-f"
};`
As I understand the ability to set custom papersize is to use ghostscript arguments -dDEVICEWIDTHPOINTS=w -dDEVICEHEIGHTPOINTS=h in that piece of code?
Hi Sherman,
I would like to thank you for your pdf scribe printer; I use it for my own project https://github.com/cedrozor/myrtille with great success! :)
I needed a PDF virtual printer for Myrtille and didn't wanted to rely on PDFCreator (I used it long time ago, but it now comes with some adware) or any commercial printer.
Yours is simple, with nice exception handling and efficient :)
Regards,
Cedric
Why every freezed up till printing...
its freezed in background
Hi,
I need guidance on how to set pdfscribe as default printer during installation of pdfscribe.
I created a custom windows form and triggered it using Application.Run(CustomForm())
and form.ShowDialog()
and form.Show()
from Program.cs in PdfScribe.
When printing a document the form is not showing, but the process keeps running in the background.
However, when I tried double clicking the exe, the form showed up. It doesn't show up only when I try to print from some other application.
I created a custom windows form and triggered it using Application.Run(CustomForm());
from Program.cs in PdfScribe.
When printing a document the form is not showing, but the process keeps running in the background. Any hints why the form not showing up ?
First of all Great Project.... Thanks..
I want to get number of copies and other settings when user did print... like
Oriantation, number of copies, number page he selected
I can not find redmon64pdfscirbe.dll source code. please, how to get it ?
严重性 代码 说明 项目 文件 行 禁止显示状态
错误 命令“powershell -command "del ((Split-Path 'E:\PdfScribe-master\PdfScribeInstall\bin\x64\Release\en-us\PdfScribeInstall_1.3.2.31825.msi' -parent) + '*.sha512')"”已退出,代码为 1。 PdfScribeInstall C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix.targets 781
Hi,
I was wondering if pdfscribe driver has been tested with windows 10? The driver works fine in Windows 7 but on Windows 10, the pdf output file is not generated. When I look in the event viewer there is an entry:
Fault bucket , type 0
Event Name: CLR20r3
Response: Not available
Cab Id: 0
Problem signature:
P1: PdfScribe.exe
P2: 1.0.6621.5424
P3: 5a868fb0
P4: System.Windows.Forms
P5: 4.7.3221.0
P6: 5b885a5a
P7: ad6
P8: 20
P9: System.InvalidOperationException
P10:
Hi @stchan, thank you for all your idea and hard work on this project. This was helped me to build my own printer. I'm not quite familiar on windows driver code. Therefore, this project costs me a lot of efforts.
Due to unsupported of Wix to build 2 platforms support msi package, then I decided to create 1 package for each platform. The one for 64-bits processor worked perfectly, but for the 32-bits one. I'm facing an win32 error with the code 216. But, with the same 32-bit package, I was able to installed on another computer of my friend.
win32 - error code 216: The image file %1 is valid, but is for a machine type other than the current machine. ERROR_EXE_MACHINE_TYPE_MISMATCH
Then I create a program (not an installer) try to create PrinterDriver only with the same function you already provided (level 6 with DRIVER_INFO_6) by calling AddPrinterDriver from winspool.drv. Unfortunately, the error's still happening.
I have searched for 3 days but it seems no clue for me to resolve this issue. Please give me a help.
Thank you so much!
Redmon redirecting to .exe as 'System' user. and it's running in the background. Exe is running is background so not working
I want use printed file name to map ,which file was converted.
Is there anything method to get it ?
Thank you.
This program used to work perfectly. After the Windows 10 1809 update (specifically, on 17763.529) PDF Scribe fails to generate any output. If you run the EXE directly from the Program Files directly, a blank PDF file is correctly generated. I first noticed the issue with a custom fork but it appears to affect the master branch of 1.0.7 as well.
I changed the project namespaces and output filenames. Printing fails with "The system cannot find the file specified" error (logged in Microsoft/Windows/PrintService/Admin in event log). Original solution works fine. Am I supposed to keep namespaces and/or output files names as is or is there a setting somewhere that I need to change to adapt namespace and output filename changes?
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.