PDF Printer driver

10 posts / 0 new
Last post
tekmage
tekmage's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2011-10-09 03:19
PDF Printer driver

Hi All,

Printing on OS 4 has always been a sore spot. Talking at AmiWest over the weekend someone mentioned that solved this by making PDF's and uploading them to the printer via FTP. While my printer does not support the FTP approach, I still think it would be cool to have a native "PDF" driver.

I'm not an experienced coder but have done some C work. My question to the OS4 coding community is how hard would this be to do? Is there any good example code available to make a printer driver for AmigaOS 4? Any reason why this would not work?

Thanks!
Bill "tekmage" Borsari

hypex
hypex's picture
Offline
Last seen: 4 months 2 weeks ago
Joined: 2011-09-09 16:20
Re: PDF Printer driver

Hi Bill.

This reminded me of an idea I had once about a virtual PS driver that accepted PostScript, which was somewhat common, that converted it to a bitmap for printing. It would have taken the PS as input, used AmiPS to convert it to bitmap, then print the bitmap using the printer device. I was going to call it "PSPRT" but never got around to it.

It's common for a printer to have a web server for setup but I wasn't aware of an FTP server as well. If the printer accepts PDF then it sounds like an expensive printer or office printer. Common printers don't accept PDF and PS is a more common format but again only the expensive printers support PS. By expensive I mean a better model that supports professional formats like PS and PDF against a common home printer that only accepts what the dedicated driver gives it.

There is example code with the HP printer driver example code by Olaf Barthel. It should be included in the SDK though I have noticed some things are moved or missing in later releases. It's what I based my HP Photosmart driver on. It probably helps to know how the printing system works. Basically there is text and graphics. For printers that support it text is usually sent off directly encapsulated within a few setup commands. And graphics are converted from an input bitmap to printer graphic commands. HP printers are like Radeon cards for OS4. They tend to be the supported hardware. At least a HP printer is most likely to work on OS4.

What printer do you have? While PDF could be useful it would only be of use for printers that support it which isn't common. Also there is the generation of PDF code to take into account. For sending text a PDF output would look nice. For graphics the rasters would need converting to PDF so a bit of processing there. Either way there will be converting from input to output which is usually a compressed data stream of some sort. AmiPDF and AmiPS can both produce PDF and PS formats using the underlying Ghostscript programs. I think I've typed enough for now. :-)

tekmage
tekmage's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2011-10-09 03:19
Re: PDF Printer driver

Hey Hypex,

Thank you for the reply. For my own use, the goal is just to easily create a PDF. I find that I create PDFs 2 or 3X the rate I send things to paper. It's also crazy that we don't have a print to PDF option given it's 2021 :p

Based on your suggestion I looked at my SDK install and did not find a printer example. I did some searching and found this: http://amigadev.elowar.com/read/ADCD_2.1/Devices_Manual_guide/node0061.html

Looking at the files there is ASM so not very helpful for someone who can manage basic python :)

W.R.T PDF generation that should be easy to get started:
http://os4depot.net/?function=showfile&file=development/library/misc/libharu.lha

There is also the process of printing to PS and externally leveraging GS to push out a PDF via folder/file watch.

Cheers,
Bill "tekmage" Borsari

hypex
hypex's picture
Offline
Last seen: 4 months 2 weeks ago
Joined: 2011-09-09 16:20
Re: PDF Printer driver

Well, printing to PDF is a modern convention. I do know what you mean, since Linux print driver tends to use PDF. But, in the case of my HP printer, that PDF will need to be converted to HP print language regardless.

I checked my SDK and it is there but the files are dated 2018. This suggests I backed it up in case it was removed and I think they have. So I decided to simply upload it to OS4Depot as it is useful. Get it while it's hot. Here you go. :-)

http://os4depot.net/?function=showcontent&file=development/example/hp_deskjet_cmyk.lha

Looks like there are some options aside from AmiPDF. I wasn't sure about creating PDF files as that tends to need exclusive Adobe software. At least last time I Googled for even a PC creator it looked that way.That HPDF would be better if it can be embedded inside a binary. Rather than say rely upon a Ghostscript executable for the work.

PS is also a good option. Things change but PS was only supported by laser printers once. Don't know about it now as printers would be more powerful as even common ones are expected to act like a wireless client AP. The Workbench has had a PS driver for years. You can set the DPI so it saves it from getting dated. I suppose what you need is a PDF variant of it.

Also I found this. Did you know there is a Google cloud print driver? Can accept PS and PDF. Kinda a work around sending a document over the internet to print locally. Like calling a friend on the mobile standing in front of you. But it's good we have this option.

http://os4depot.net/index.php?function=browse&cat=driver/printer

tekmage
tekmage's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2011-10-09 03:19
Re: PDF Printer driver

Thanks for the source Hypex. Sadly the Google print service is no longer supported. It was a great option while it was running. From the Google website:

Note: After December 31, 2020, Google Cloud Print will no longer be supported.

There is a service called Mopria: https://mopria.org/certified-products. Now sure what it would take to support that but it looks like an analog to the Google print service.

hypex
hypex's picture
Offline
Last seen: 4 months 2 weeks ago
Joined: 2011-09-09 16:20
Re: PDF Printer driver

Hope the source helps.

I must be behind. I didn't know it was cancelled already. Good to know there other ways about it.

Also having a way to hook into printer prefs and set the driver as well as transport would help. The Amiga system is somewhat backwards to how things are done now. Back then you selected your driver by hand and set up the transport layer. These days, you plug a printer in, the system detects it, determines driver and sets it up all ready to go. :-)

mcleppa
mcleppa's picture
Offline
Last seen: 1 year 8 months ago
Joined: 2021-12-19 00:03
Re: PDF Printer driver

I am looking into the same issue, to get more printer support. At the moment I would like to know more about how to write and compile a printer.device. Neverthless I have started to look into ipp which seems to be the printing protocol that all new printers support today. I have so far successfully managed to print jpegs with this protocol. IPP is an open source protocol which is documented in ietf.org, and seemed to me to be the best option so far for amiga. Anyone interested in this I happily share my work I have done so far. The biggest challenge here will be converting to pwg-raster, which is the most common and open format most printers support these days.

hypex
hypex's picture
Offline
Last seen: 4 months 2 weeks ago
Joined: 2011-09-09 16:20
Re: PDF Printer driver

@mcleppa

Probably the best source of information is the driver source I uploaded above. I don't know of any other information in the SDK or online. The older NDK would have it but the source above has OS4 ready code to go.

mcleppa
mcleppa's picture
Offline
Last seen: 1 year 8 months ago
Joined: 2021-12-19 00:03
Re: PDF Printer driver

Much appreciated and helpful source!

jaokim
jaokim's picture
Offline
Last seen: 2 months 1 week ago
Joined: 2011-06-02 15:27
Re: PDF Printer driver

I’ve got this setup using the Postscript printer with WordWorth setup to print to file by default, then a script with WaitNotify to trigger a script that converts it (using Ghostscript I think? Or amips/pdf?) into a PDF.

The script is on
os4depot.

Log in or register to post comments