“Install a Virtual PDF printer in Network”

1. Hardware and Software

  1. ubuntu server [Any debian distro should work]
  2. Raspberry pi
  3. IPhone [To Test]

Install CUPS and CUPS-PDF Package

sudo apt-get install cups
sudo apt-get install printer-driver-cups-pdf

Edit cups Daemon config

sudo nano /etc/cups/cupsd.conf

Enable the cups web interface to accesss from anywhere

Search for:

Listen localhost:631

Modify to :

Port 631

Allow access from any host in the network

Modify the Following sections as below

<Location />
  # Allow remote access...
  Order allow,deny
  Allow @local
</Location>
<Location /admin>
  Order allow,deny
  Allow	@local
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
    Order allow,deny
  Allow	@local
</Location>

Save the file and Quit

Give Permission local user to add printer

sudo usermod -a -G lpadmin <username>

Restart Cups Server

sudo service cups restart

Configire the Virtual PDF Printer

sudo nano /etc/cups/cups-pdf.conf

Go to Path Settings -> Change the value of Out
This is the location which PDF files are saved for the default user

Out ${HOME}/PDF

Change the value of AnonDirName
Location of all the PDF files printer by other users

AnonDirName /home/ubuntu/dev/PDF

Goto Filename Settings > Label change to 1

1: label all documents with a preceeding “job_#-“

Label 1

Goto User settings > AnonUser
I am not sure this chage is need or not

AnonUser ubuntu

Save the file and exit
Now add the Virtual pdf printer through CUPS interface

Access the Cups Web Interface

1.http://<Ip address of the cups server>:631
2.Goto Administrataion > Add Printer
CupsConfig1 CupsConfig2 CupsConfig3 CupsConfig4

Click on Add Printer

CupsCOnfig5

Once printer is added, Modify settings like above. Click Change Settigs. It will save and restart the server
Now open the iphone print screen you should be able to see virtual pdf printer

CupsCOnfig6

Give a print and you should see the PDFs in:

cd ~/PDF

Extra Commands:

To Restart the cups

 sudo service cups restart

To see the Cups Service Status

sudo service cups status

Default logs Location

cd /var/log/cupbbs