I need to create an app (C++) that will use the printer to print specific stuff (mostly small black filled squares) on special preprinted cards that will be given to me. The locations of the squares are to be determined in the app.
So I guess I will need to measure the card and find the coordinates of the proper spots to print on. Then convert those to pixels (?) .
Another thought is to scan the preprinted card and somehow use it as an image, draw on it and then print it.
Perhaps combining the app with tools like Word or some image processing app might be a better option. If you have come across anything similar, I would like to hear about it 😉
EDIT : Windows OS, using MFC, the app should work with most printers, using another language unfortunately is not an option, but combining tools could be, if it facilitates the process.
You can use CPrintDialog or CPrintDialogEx to allow the user to select a printer, which will return a DC and a DEVMODE structure. The fields in the DEVMODE will give you the page size and the DPI (in the
dmYResolutionanddmPrintQualityfields) which you can use to convert inches to pixels.