How to write a Mac PCL Printer Driver? - macos

I am currently developing printer drivers for Mac which should support both PS (postscript) and PCL printers. I already have an idea about supporting PS (by defining custom CUPS postscript filters in the PPD, and a PDE).
What I don't have an idea about is supporting PCL printers.
a) Is PCL automatically supported by CUPS?
b) If answer to a) is YES, will my PS filter be called when printing to a PCL printer? (I add some PJL to the print data in my PS filter).
c) If anwer to a) is NO, then how should I implement support for PCL? (I need to add some PJL to the PCL data that will be sent to printer).

have you seen https://developer.apple.com/legacy/library/samplecode/SampleRaster/Introduction/Intro.html
?
After fiddling around with Xcode build paths and build settings I got it to work. Its a complete printer driver with cups backend and filter.
kind regards,
Robert

Related

Do Android Automotive OS support OpenCV OpenGL and multiple screen

I am trying to convert the desktop app to Android Automotive OS (AAOS). I am using OpenCV DNN for object tracking. Also, I am using OpenGL to render the contents. Rendering outputs (2 full HD) must be displayed on two monitors (must be full screen). Also, I must send some data using serial communication. I don't have any experience with AAOS. So I can not decide to this app doable or not on AAOS. So If you have any experience with AAOS can you give me any feedback about this project. AAOS runs on Snapdragon SA8155.
Dev board link:
https://www.lantronix.com/products/sa8155p-automotive-development-platform/#tab-features
Android Automotive supports multiple screens. And specifically this platform provides multiple video outputs.
You should check whether mentioned features are supported by provided Android distributive. Most certainly the distro is supplied by Qualcomm. In this case you need to get access to Qualcomm's documentation.

Mono - Native UI on each platform?

Is it possible to have one core dll written in mono and 3 separated native UIs on Linux, Mac and Windows? If yes, what are the options I have?
Let's assume I have written a GUI with WPF (Windows) and now I want to connect the mono dll to the WPF Form so I can use it's exported functions and classes. Same on Mac OS X: GUI written in Cocoa and connected to a mono core dll?
Do you guys know any example projects, which uses that approach?
Well, you can use a PCL library that contains your logic, combined with the Xamarin.Mac framework on OSX, GtkSharp on Linux, and WPF on Windows. As for using raw Cocoa, that'd be tougher; you'd have to host the Mono runtime (which is not impossible but also not easy).
Edit: I should add that you could also try for a "write once" UI and use GtkSharp for all three.
I found a possible solution: https://github.com/picoe/Eto
It does exactly what I was looking for!

Translates the XInput calls to DirectInput calls on MAC OS X (Emulate x360 controller from PS3 one)

There are a lot of games in steam working with x360 controllers but not mapped properly with a PS3 DS3 controller...
MotionInJoy do it clean with "emulate 360 controller" but it works only on PC.
There is another PC-only project : x360ce : https://code.google.com/p/x360ce/
Here is the question : is there any solution for mac os x ?
If not, why !?
There is not a solution on OSX that reads DirectInput and emulates XInput.
I took a look at x360ce. It uses SharpDX to communicate on both DirectInput and Xinput APIs, so it'd be a great start for an app like this. Problem is it's written in C#. This is why there is no solution in OSX--the best library for interfacing with DI/XI is written (naturally) in a Microsoft language.
I think we'd need something like Mono to run .cs on mac, I'm not sure.
Not a small project to either write a native interface to DI/XI or run SharpDX on a mac, but it'd be pretty educational.

Counting printed pages in OSX

I'm developing an app for the Mac OS X that provides various system statistics. I have a little problem with the printer because I have never worked with it before. Is there any way to listen to the printer and count pages printed in color and in b&w?
Edit: I remember that I was using a Mac OS X kiosk machine once and it offered color and b&w prints priced per page, so there must be a way to do this. Also, I develop this app for my own needs and for practice so the solution doesn't have to be universal.
I'm pretty sure access to this information is specific to individual printer models. I don't believe there's a system API that will help you here as it would require querying individual printer drivers or utilities.
The Core Printing Reference which is the documentation for the Mac OS X printing API doesn't appear to contain any calls that would allow you to extract this information from a printer.

How to create a virtual printer in Windows?

I want to create a virtual printer driver for Windows. How and where can I start properly? The WDK has some printing drivers examples that do not seems a good introductory. MSDN also doesn't seems to be very helpful for a novice.
There are a lot of virtual printers for Windows out there (mostly they generate PDFs), I wonder if someone could tell my how can I do the same?
Any links to the elaborating documentations are appreciated in advance.
Thanks.
When I did it (which about 12 years ago) I started with the postscript driver sample, replaced all the postscript-specific stuff (in my case, to write to a bitmap instead of generating postscript commands).
I also wrote a custom print monitor (the driver writes to the spooler, which write to a monitor): my monitor wrote to a file instead of e.g. to the parallel port.
However, printer driver architecture and/or the set of sample drivers may have changed since then.
You can look to the 'minidriver' development in the from Microsoft (Microsoft MDT), that might help depending on your exact needs. If the port you need to deal with (ie: you are going to take the data from an existing printer driver and want to process) you could look to the source code for RedMon. It doesn't support Vista/Win7 but might point you in the right direction.
This book maybe help you Developing Drivers with the Windows® Driver Foundation
A list of my links
http://www.codeproject.com/KB/system/driverdev.aspx
http://www.microsoft.com/whdc/ddk/winddk.mspx
http://jungo.com/wdusb.html
https://web.archive.org/web/20130717135254/https://msdn.microsoft.com/en-us/library/ff554651.aspx
http://channel9.msdn.com/posts/Rory/Driver-Development-and-Much-More-With-Mike-Calligaro/
One of the drivers you mention is open-source (GPL), maybe you could explore its source or adapt it: http://www.pdfforge.org/products/pdfcreator/download
Someone else already mentioned PDFCreator. Here's a more specific link to their code that's creating the printer, port and monitor. Despite being in VB, I can follow it as someone more used to C++, so I guess you can too. modPrinter.bas does the leg work. modMain.bas, from about line 28 onwards, calls into modPrinter.bas.
Create a Print Port Monitor, associate that port with a printer, and you'll get the data the printer driver sends to the port.
working example of how is it done in Cpp and java can be found here:
http://www.mms-computing.co.uk/uk/co/mmscomputing/device/printmonitor/index.php

Resources