How to print to PDF using REAL PRINTER drivers? - pdf

Is it possible to test printer driver correct working without having a printer physically? I suppose this is it not possible because each printer uses its own print commands and protocol, so in most cases driver's output will not be recognized by 3d-party tools. But who knows...
You can find below root of the issue and what I tried to do.
A client complains that our PDF file is not printing correctly with their HP_LaserJet_Enterprise_M506-PCL_6_Win8_Plus_Full_Soln_18141.exe 8.00.1329.4861 drivers. For testing purposes the client tried to use HP Universal Print Driver for Windows PCL6 (64-bit) 6.8.0.24296 and and was able to print with no issues. But unfortunately they are using programs that require specific model drivers.
So, I tried to install printer drivers (different printers, actually) and map them to corresponding virtual ports for the following:
PDFCreator
CutePDF Writer
doPDF
OneNote
Print to file
Unfortunately, nothing helps. PDFCreator returns "Internal Ghostscript error. (29100)"; cutePDF produces empty PDF; doPDF do nothing; OneNote generates unspecific error; print to file generates .prn which is useless without the specific printer.
So, I'm pretty sure that there is no way to verify that the drivers produces correct output stream without having physical printer corresponding to this driver. But I will be glad to be mistaken.

Related

Can I preserve fillable fields in a PDF with Apple Cups?

I have setup a remote Ubuntu server, it has cups-pdf on it. I have a Windows 10 client it is able to print to it using an HP Universal Printer driver.
The thing is, we're trying to send fillable pdfs and the fillable fields are stripped out... that is probably obvious but I want to know if it's possible to keep the fields...
Are they already gone by the time they hit the server or can I stop them from being stripped out on the cups side?
I know it would be easier to just do file upload... it's an interop problem where printing is the best way to get the files around.

Cant print with Adobe Acrobat 5.0 PDFWriter, Windows 10, VB6, and Crystal Reports?

I am hoping to get some help with a work problem I recently "inherited"... The company I am working for has rendered my services to help them get their information system application migrated from Windows XP machines to Windows 10 machines. The core components of the program were developed in Visual Basic 6, Crystal Reports 8, and Adobe Acrobat 5. I already know 99% of peoples answers are along the lines of "You need to upgrade" or "Why are you using that?!". For those people, the answer is simply because my immediate need is to use what I was given, and the eventual plan is to migrate everything over to newer versions of these core components.
I have made some code adjustments already and found some other updated drivers for other dependencies, and so far through initial testing, it seems the application is performing as expected.
Unfortunately, yesterday, I hit a major snag where the application is trying to print to the "Adobe PDFWriter" printer, which doesn't seem to be installed on Windows 10, even though I installed Adobe Acrobat 5.0, as administrator, with the "Include PDFWriter files" option checked during install.
I can't find the printer in the list of printers.
I can't find any specific ports or drivers for Adobe when trying to
manually add the printer.
The main PDFWriter dll, "pdfddui.dll", and supporting dlls,
("pdfdd.dll", "pdfkd.dll") do not exist under the
"Windows\System32\spool\drivers" location, which is where they are
found on a working Windows XP machines.
The main dlls and supporting dlls mentioned above DO exist under
"Windows\System32\spool\drivers\x64"
When searching the registry for the main dll or supporting dlls,
nothing is found, suggesting the dlls weren't able to successfully
register.
When trying to manually register the dlls using
"\Windows\SysWoW64\regsvr32.exe" it fails.
When trying to manually register the dlls using
"\Windows\System32\regsvr32.exe" it fails.
The code that is executing is doing the following:
It dynamically builds a crystal report from a SQL query based on
parameters from a form.
It uses the crystal reports "SelectPrinter" function to specify the
Printer.DriverName, Printer.DeviceName, Printer.Port
It uses the crystal reports "PrintOut" function to specify not to
prompt the user for any input, i.e. "silent print".
The end result, what I need to replicate, and what I need the communities help with is that Crystal Reports:
Prints the file as a PDF SILENTLY with NO user action required.
Prints the file with a specific filename.
Prints the file to a specific location.
I have tried using Microsofts built-in Print to PDF, and that works, BUT it prompts the user to save the file, it also has the wrong default filename and location, and I see no way to programmatically change that from VB6.
I would imagine newer versions of Adobe Acrobat ARE NOT compatible with Visual Basic 6, additionally, the licenses for Adobe Acrobat are kind of pricey when the ONLY functionality I need is the ability to programmatically print to PDF.
Any useful comments, suggestions, resolutions will be very much appreciated!
Why don't you add an intermediate, behind-the-scenes, step to export the Crystal Report to a PDF file and then print the PDF file using ShellExecute or another method.
pid = ShellExecute(0&, "print", DocFile, vbNullString, vbNullString, vbNormalFocus) is what I use to print PDF files automatically from VB6.
If that doesn't work, I have used a printer driver called CutePDF. It is free and Windows 10 ready.

How to create a Virtual PDF ESC/POS Printer to make some tests while programming?

I need to send the tickets directly from the Point of Sale to an ESC/POS printer.
I was wondering if the only chance to print in a ESC/POS printer is to use the PosBox to print tickets directly from Odoo or if there is another way.
The PosBox is a little hardware box based on a Raspberry-Pi that will handle all the peripherals' drivers and setup in a very easy way
So my questions are:
How could I create a Virtual ESC/POS Printer? I would like to use something similar to the Virtual PDF printer, in order to print the tickets to PDF and make some test while I am programming. Is that possible?
What is there in the PosBox image ("Raspberry Pi Image") to make it work everything out of the box?
If I have the ESC/POS printer correctly installed and connected to a computer with Windows System. The Odoo Server is accessed remotely from this computer. I have installed the hw_escpos module. Could this work or the use of the PosBox is mandatory?
I am working with PosBox so as per me if you are managing odoo remotely and your printer is attched with some our system which is not direcly connected to you odoo server so in this case you need some extra device to bridge your harware(printer) and software(odoo). So here PosBox comes in picture. Or any other device if they can compatible with both system so it is also useful. In case of your answer:
1) If you are programming and you want to check printed ticket's PDF then you can do it via your xml template file. From that you can pass arguments under <report> tag.
2) In PosBox we need to insert an image i.e. OS image so that this device can work as your CPU of your system. In that image there are some h/w modules of odoo. i.e. hw_escpos, hw_proxy, hw_scale etc. kind of hardware modules are there. Also apart from this one odoo instance is running on from that device so you can manage all data from that link.
3) If all things are connected in a single system and odoo is working remotely then no need to you PosBox to print ticket. PosBox only helpful when your printer is attached remotely in any other place and odoo is working to any other system and after this you are accessing odoo to any 3rd system and you want to print ticket where printer is connected any else system so then and then only need to use of PosBox.

Managing Adobe PDF printer- How to force off the option to rely on system fonts

I am running a Citrix-driven environment, and I have a vital piece of software that creates a PDF repository of all reports as they run. The problem I have is that the users' printers must populate into the environment (Not just the default printers- ALL of them), and a number of the computers have Acrobat 9 or X on them. The software that creates the reports REQUIRES that the Rely On System Fonts is turned off, but some users have it turned on when it comes to the PDF printer on their computers. Sometimes, when user x goes to create a report, it will grab the printer from user y's session that may not have the option properly unset- Then user x's irreplaceable report is lost. The application is a Dexterity application, and I don't have access to the source. Is there a way, in Citrix or in AD, to script this one option to be unset properly? Any idea if there is a registry key or some kind of hook I can activate with a powershell script to fix this headache? I appreciate any help.
I have been researching for weeks to figure this out for myself, and I was looking for one more answer and found your question. To fix your problem I was able to find that the registry key found here:
[HKEY_CURRENT_USER\Printers\DevModePerUser]
Contains all of the current printer properties. If you export it, you can run a script to add the reg key during login. Just make sure that you restart the spooler after words, just to make sure that the changes apply. Also the settings will only apply to the printer with the same name, so you have to have a different reg key for each different printer name, if you have several. I just esported the key after I had changed the printer settings to how I liked them, and then edit the .reg file to remove any data about other installed printers to make sure that the .reg file wouldn't affect any other printers.
Apparently, this problem is a common problem. Microsoft has acknowledged that the PDF creation issue I am trying to avoid is an issue in GP, starting in (Think it was version) 7. The Microsoft-recommended workaround is to open the PDF Printer properties and uncheck the Use System Fonts box. Adobe does not support this configuration, so they will not provide a clear way to implement it at a network level with clients in many locations and 4 different major versions of Acrobat. The closest I came was a post that identified an incredibly long string I have to hexedit that seems to change in specific minor versions of Acrobat. Way to go M$ and Adobe. So, in other words, no support on major product lines from two major companies. I have nowhere else to go at this point. If anyone else has a solution to this problem, I'd love to hear it. Thanks!

Creating PDF file in PowerBuilder

I am new to PowerBuilder. I got an assignment to create a PDF file using PowerBuilder. How can I do that?
Our organization used to use Ghostscript, but has instead moved to Amyuni.
as suggested by Alberto Megia, download PDF creator, but dont use SAVE AS.
After you install pdf creator it will install a printer, use that printer to save the
datawindow with the print function.
after call print function, you will see a "Save as" dialog.
If you use "saveas" function, the pdf will not have the format that the datawindow shows.
What version of PowerBuilder are you using? The most recent versions have PDF capability built in (using Ghostscript).
Install Ghostscript.
Get PDFCreator for free there and install it.
Then you can save as PDF any datawindow or datastore with the statement:
dw_1.saveAs(path_where_to_save_with_name_of_file.pdf, PDF!, true)
Third parameter is for override if the file exists with that name. I hope it works for you.
Regards,
Alberto
We just use Ghostscript. I wrote Ghostscript setup instructions earlier. We also print Word documents we've filled in to PDF from our app by printing them to 'Sybase DataWindow PS' printer then running Ghostscript to make the PDF.
Good Question - There really isn't an easy way other than finding a third party tool. I've tried the prior method mentioned and it does work but not without headaches and you are left with deployment headaches, deploying ghost script and having to make sure Post Script drivers are on the client.
I ended up trying many PDF converters, both free and paid, the one that worked most seamlessly was one that installed as a "printer" such as if you have Adobe installed on the PC, but you need to dynamically verify existence of the printer via RegistryGet and if it doesn't exist ask user to install or install it dynamically via code, and registry entries (not fun).
After several headaches mostly related to deployment issues I ended up going with a server solution, but it requires having a server that you can have a process (distiller) running that grabs post script files and distills them to PDF. I used a response window with progress bar, the PB app printed post script file to server location upon which the distiller grabs and converts. My PB app polls the server until it finds the PDF, or the user cancels whichever comes first. With a good distiller the process is fast (< 5 seconds) which was acceptable to our users.
Upon existence of the PDF, we'd attach it to an email and send via Oracle (mapi). This solution limits the requirements on client to post script driver which in most corporate environments is there, but you need to check it via Registry. Maybe there is a better solution out there since I did this last, around 2008.
fyi- I usually don't make vendor recommendations but will in this case because there was one that stood out in ease of use and quality, it was called PDFCreator which installs as a windows printer. It looks to be open-source right now but I recall that we would have had to pay to use it in corporate environment.
Good Luck.
Use the tutorial How to use PowerBuilder to create PDF file?.