Tag Archives: cups

Saving Form Data in Adobe Reader, on a Mac … even if Adobe tries to keep me from doing it

So, for some reason, Adobe does not want users to fill in form data in PDF files and save the modified copies. Alright, fine, there may be a good reason for that (probably something to do with money) … but we wants it, anyway, precioussss.

Now, being on a Mac, my natural reflex was to go “Print->Save As PDF…”, but alas …

Can't Save As PDF

Can't Save As PDF

*sigh* … let’s try “Print->Save As PostScript…” …

Can't Save As PostScript

Can't Save As PostScript

OK, Adobe really means it, Google to the rescue? Well, almost, or kind of. Google knows this page, but unfortunately it suggests “Save As PostScript…”. Been there, done that. I’m guessing somebody at Adobe has read that blog, too, and decided to stop people from trying that. Now what?

People have suggested using a PDF printer or a printer the driver of which allows redirection to PDF. Of course, I didn’t see why I should have to go to that extra length, when printing the file must spool it somewhere. So, here’s an alternative solution which I considered simpler, as it requires no additional software/driver.

  1. Have a printer installed on your Mac with the generic PostScript driver
  2. Suspend the printer
  3. Print filled-out PDF to suspended printer
  4. Look at the contents of /var/spool/cups with administrative permissions (e. g. from a Terminal in a root shell … sudo, etc. … you know the routine)
  5. Copy the file starting with “d” (e. g. d00186-001) to somewhere the regular user can access it and make sure the user has permission
  6. As the regular user open the file with Preview and watch the file (that originally was a PostScript file) be converted to PDF (ref. here)
  7. Save at your discretion

And I’m fairly confident Adobe won’t be able to prohibit that *rolls eyes*

Tagged , , , , , , , , , ,

D-Link DNS-323 as print and scan server (part 2)

In my previous post I described how I hooked up my printer and scanner to my D-Link DNS-323 NAS device for network printer and scanner services. With that done, I wanted to be able to make photocopies without an extra PC turned on. Should be a piece of cake, right? Scan an image, print it, what can be so hard about that? … famous last words of an IT professional. Of course, I also wanted this to happen on the push of one of the front panel buttons of my scanner.

So, first you need to be able to print locally from the DNS-323 as opposed to a PC queueing a print job on the DNS-323. A quick test: ssh as root to the box, lp /etc/passwd, does not work, perfect! Printing on the same printer always worked like a charm with CUPS on my ubuntu machines, so off we go and install cups from the optware repository. Try adding a printer definition to cups, but where is my USB printer? Digging really deep inside cups tells me the usb backend detects the printer perfectly well, but cups-deviced does not, nor does lpinfo -v list it, marf. More research yields, I will need a driver for the Samsung proprietary printer language SPL2 or QPDL, anyway. So, back to square one and take a look at splix and, because I can’t get cups to work, at foomatic-rip.

I installed perl and ghostscript to get foomatic-rip to work and compiled splix for optware. Tested the two in conjunction and, of course, it did not work. The ghostscript version available from optware claims to provide the cups device but I couldn’t get output that splix could process. No big deal, because splix still has the pbm support (apparently from older versions) which I reactivated. So, instead of relying on foomatic-rip to convert an input format to cups raster format and then on splix’s rastertospl2 to convert that to something understandable by the printer, I turned to pbm as an intermediate format. You can download the optware ipkg here. If you want to compile it yourself you can download the source package definition here, until I submit it to optware. This package, of course, preserves the now standard rastertospl2 in addition to pbmtospl2.

Now, you don’t even need foomatic-rip but can just do the following:

  1. cat align.ps | gs -r300 -q -dNOPAUSE -dBATCH -dNOMEDIAATTRS -sDEVICE=pbmraw -sOutputFile=output.pbm -
  2. /opt/lib/cups/filter/pbmtospl2 -P /opt/share/cups/model/samsung/ml2010de.ppd -p A4 output.pbm > output.spl2
  3. /sys/crfs/LPRng/lpr output.spl2

Here, align.ps is the alignment testing document available from openprinting.org. Any other PostScript document will do, but be aware that the “gs” command can take quite a while (and we’ll have more of that in the next post of this series).

Tagged , , , , , , ,