Skip to content

Commit

Permalink
Installer now automatically adds printer without requiring user confi…
Browse files Browse the repository at this point in the history
…guration.

Consequent modifications to ReadMe
Simplification of PDFfolder icon
Removal of resolution option in PPD since it had no effect
  • Loading branch information
rodyager committed Jun 4, 2016
1 parent 8cfa70b commit 8cda9d7
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 108 deletions.
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,8 @@ An OSX print to pdf-file printer driver
##About RWTS PDFwriter
**RWTS PDFwriter** in an OSX 10.11 compatible print driver that enables you to “print” your documents directly to a pdf file. It has similar functionality to [CutePDF](http://www.cutepdf.com) on Windows.

## Installation, Configuration and Usage Instructions
Download the installer package by clicking on the printer icon above and install as usual.

After Installation has been completed, open **System Preferences** and select **Printers & Scanners**. You will see a window like this. (In this example, there's already a printer installed)

![](https://raw.githubusercontent.com/rodyager/RWTS-PDFwriter/master/sources/README.rtfd/P%26S1.tiff)

Now click on the + button to add a new printer.
A new window will open. Click on the Default icon if it is not already selected. You will see a list of all the printers currently directly connected to your Mac or advertising their existence on your network.

![](https://raw.githubusercontent.com/rodyager/RWTS-PDFwriter/master/sources/README.rtfd/P%26S2.tiff)

Now select **PDFwriter** and wait a few seconds until **RWTS PDFwriter** appears in the combobox at the bottom of the dialog window.

![](https://raw.githubusercontent.com/rodyager/RWTS-PDFwriter/master/sources/README.rtfd/P%26S3.tiff)

Click the Add button and your new printer will be ready for use.
## Installation and Usage Instructions
Download the installer package by clicking on the printer icon above and install as usual. After installation, your new printer will be ready for use.

### Usage

Expand Down
Binary file removed sources/PDFfolder.iconset/icon_128x128.png
Binary file not shown.
Binary file removed sources/PDFfolder.iconset/[email protected]
Binary file not shown.
Binary file removed sources/PDFfolder.iconset/icon_16x16.png
Binary file not shown.
Binary file removed sources/PDFfolder.iconset/[email protected]
Binary file not shown.
Binary file removed sources/PDFfolder.iconset/icon_256x256.png
Binary file not shown.
Binary file removed sources/PDFfolder.iconset/[email protected]
Binary file not shown.
Binary file removed sources/PDFfolder.iconset/icon_32x32.png
Binary file not shown.
Binary file removed sources/PDFfolder.iconset/[email protected]
Binary file not shown.
Binary file removed sources/PDFfolder.iconset/icon_512x512.png
Binary file not shown.
Binary file removed sources/PDFfolder.iconset/[email protected]
Binary file not shown.
Binary file removed sources/README.rtfd/P&S1.tiff
Binary file not shown.
Binary file removed sources/README.rtfd/P&S2.tiff
Binary file not shown.
Binary file removed sources/README.rtfd/P&S3.tiff
Binary file not shown.
90 changes: 26 additions & 64 deletions sources/README.rtfd/TXT.rtf
Original file line number Diff line number Diff line change
@@ -1,93 +1,55 @@
{\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red63\green105\blue30;\red246\green246\blue246;
\red0\green0\blue255;}
{\colortbl;\red255\green255\blue255;\red63\green105\blue30;\red246\green246\blue246;\red0\green0\blue255;
}
\paperw11900\paperh16840\margl1440\margr1440\vieww14540\viewh21700\viewkind0
\deftab720
\pard\pardeftab720\qc\partightenfactor0

\f0\b\fs28 \cf2 \expnd0\expndtw0\kerning0
\f0\b\fs36 \cf0 \expnd0\expndtw0\kerning0
PDFwriter for Mac OS X\
\pard\pardeftab720\sl980\sa240\qc\partightenfactor0
\fs86 \cf2
\b0\fs24 \kerning1\expnd0\expndtw0 {{\NeXTGraphic background.png \width1843 \height1843
}¬}\expnd0\expndtw0\kerning0
\b0\fs28 \cf0 \kerning1\expnd0\expndtw0 {{\NeXTGraphic background.png \width5120 \height5120
}¬}\pard\pardeftab720\sl980\sa240\qc\partightenfactor0
\cf0 \expnd0\expndtw0\kerning0
\
\pard\pardeftab720\partightenfactor0

\b\fs28 \cf2 Configuration and Usage Instructions
\b0\fs24 \
After Installation has been completed, open \cf3 System Preferences\cf2 and select \cf3 Printers & Scanners\cf2 . You will see a window like this. (In this example, there's already a printer installed)\kerning1\expnd0\expndtw0 \
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardeftab720\pardirnatural\qc\partightenfactor0

\fs42 \cf2 \expnd0\expndtw0\kerning0

\fs24 \kerning1\expnd0\expndtw0 {{\NeXTGraphic P&S1.tiff \width4527 \height5126
}¬}\expnd0\expndtw0\kerning0
\
\pard\pardeftab720\partightenfactor0
\cf2 Now click on the + button to add a new printer. A new window will open. Click on the Default icon if it is not already selected. You will see a list of all the printers currently directly connected to your Mac or advertising their existence on your network.
\fs20 \
\pard\pardeftab720\qc\partightenfactor0

\fs24 \cf2 \kerning1\expnd0\expndtw0 {{\NeXTGraphic P&S2.tiff \width4535 \height3905
}¬}\pard\pardeftab720\qc\partightenfactor0

\fs42 \cf2 \expnd0\expndtw0\kerning0

\fs24 \
\pard\pardeftab720\partightenfactor0
\cf2 Now select \cf3 PDFwriter\cf2 and wait a few seconds until \cf3 RWTS PDFwriter\cf2 appears in the combobox at the bottom of the dialog window.\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardeftab720\pardirnatural\qc\partightenfactor0
\cf2 \kerning1\expnd0\expndtw0 {{\NeXTGraphic P&S3.tiff \width4535 \height3905
}¬}\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardeftab720\pardirnatural\qc\partightenfactor0
\cf2 \expnd0\expndtw0\kerning0
\
\
\pard\pardeftab720\partightenfactor0
\cf2 Click the Add button and your new printer will be ready for use.
\fs28 \
\pard\pardeftab720\sl312\slmult1\partightenfactor0

\b \cf2 Usage
\fs36 \
\b \cf0 Usage\
\pard\pardeftab720\partightenfactor0
\b0\fs24 \cf2 Simply print your documents using \cf3 PDFwriter\cf2 as your printer.\
\b0 \cf0 Simply print your documents using \cf2 PDFwriter\cf0 as your printer.\
The \'93printed\'94 PDF files produced will be stored in the directory\
\pard\pardeftab720\partightenfactor0
\pard\pardeftab720\sl288\slmult1\partightenfactor0

\f1 \cf2 \cb4
\fs20 /Users/Shared/PDFwriter/<your user name>
\f0\fs24 \cb1 \
For convenient access to this folder, simply drag it to the right hand end of your dock.\
\f1 \cf0 \cb3 /Users/Shared/PDFwriter/<your user name>
\f0 \cb1 \
\pard\pardeftab720\partightenfactor0
\cf0 For convenient access to this folder, simply drag it to the right hand end of your dock.\
\pard\pardeftab720\sl312\slmult1\partightenfactor0

\b\fs28 \cf2 Removal instructions
\fs48 \
\b \cf0 Removal instructions\
\pard\pardeftab720\partightenfactor0
\b0\fs24 \cf2 If you want to uninstall \cf3 PDFwriter\cf2 , open Terminal.app, type\
\pard\pardeftab720\partightenfactor0
\b0 \cf0 If you want to uninstall \cf2 PDFwriter\cf0 , open Terminal.app, type\
\pard\pardeftab720\sl288\slmult1\partightenfactor0

\f1 \cf2 \cb4
\fs20 /Library/Printers/RWTS/PDFwriter/uninstall.sh
\f0\fs24 \cb1 \
and press Return. You will be asked for your admin password. After hitting Return, \cf3 PDFwriter\cf2 will be entirely removed from your system.\
\f1 \cf0 \cb3 /Library/Printers/RWTS/PDFwriter/uninstall.sh
\f0 \cb1 \
\pard\pardeftab720\partightenfactor0
\cf0 and press Return. You will be asked for your admin password. After hitting Return, \cf2 PDFwriter\cf0 will be entirely removed from your system.\
\pard\pardeftab720\sl312\slmult1\partightenfactor0

\b\fs28 \cf2 History and acknowlegements
\fs48 \
\b \cf0 History and acknowlegements\
\pard\pardeftab720\partightenfactor0
\b0\fs24 \cf2 RWTS PDFwriter is closely based on {\field{\*\fldinst{HYPERLINK "http://sourceforge.net/projects/pdfwriterformac"}}{\fldrslt \cf5 Lisanet PDFWriter}} by Simone Karin Lehmann. Lisanet PDFwriter was, in turn, based on the CUPS-PDF project.
\fs28 \
\b0 \cf0 RWTS PDFwriter is closely based on {\field{\*\fldinst{HYPERLINK "http://sourceforge.net/projects/pdfwriterformac"}}{\fldrslt \cf4 Lisanet PDFWriter}} by Simone Karin Lehmann. Lisanet PDFwriter was, in turn, based on the {\field{\*\fldinst{HYPERLINK "http://www.cups-pdf.de"}}{\fldrslt \cf4 CUPS-PDF}} project.\
\pard\pardeftab720\sl312\slmult1\partightenfactor0

\b \cf2 Copyright Notice
\b0\fs24 \
\b \cf0 Copyright Notice
\b0 \
\pard\pardeftab720\partightenfactor0
\cf2 This software and source code is distributed under the terms of the GNU GPL version 2 or later. Complete source code can be downloaded from {\field{\*\fldinst{HYPERLINK "http://github.com/rodyager/rwts-pdfwriter"}}{\fldrslt \cf5 http://github.com/rodyager/rwts-pdfwriter}}\
\cf0 This software and source code is distributed under the terms of the GNU GPL version 2 or later. Complete source code can be downloaded from {\field{\*\fldinst{HYPERLINK "http://github.com/rodyager/rwts-pdfwriter"}}{\fldrslt \cf4 http://github.com/rodyager/rwts-pdfwriter}}\
\pard\pardeftab720\sl312\slmult1\partightenfactor0
\cf2 \'a9 2016 Rodney I. Yager}
\cf0 \'a9 2016 Rodney I. Yager}
Binary file modified sources/README.rtfd/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions sources/RWTS PDFwriter.ppd
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,6 @@
*PaperDimension TabloidExtra/Tabloid Extra: "864 1296"
*PaperDimension Tabloid/Tabloid: "792 1224"

*OpenUI *Resolution/Output Resolution: PickOne
*OrderDependency: 100 AnySetup *Resolution
*DefaultResolution: 300dpi
*Resolution 150dpi/150 DPI: "<</HWResolution[150 150]>>setpagedevice"
*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]>>setpagedevice"
*Resolution 600dpi/600 DPI: "<</HWResolution[600 600]>>setpagedevice"
*Resolution 1200dpi/1200 DPI: "<</HWResolution[1200 1200]>>setpagedevice"
*Resolution 2400dpi/2400 DPI: "<</HWResolution[2400 2400]>>setpagedevice"
*CloseUI: *Resolution

*CloseGroup: General

*DefaultFont: Courier
Expand Down
27 changes: 11 additions & 16 deletions sources/buildscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ mkdir -m 775 pkgroot/Users/Shared
echo "#### populating directory structure"

iconutil -c icns -o $PDFWRITERDIR/PDFwriter.icns PDFwriter.iconset
iconutil -c icns -o $PDFWRITERDIR/PDFfolder.icns PDFfolder.iconset
clang -Oz -o $PDFWRITERDIR/pdfwriter -framework appkit -arch x86_64 -mmacosx-version-min=10.9 pdfwriter.m
cp uninstall.sh $PDFWRITERDIR/uninstall.sh
clang -Oz -o $PDFWRITERDIR/pdfwriter -framework appkit -arch x86_64 -fobjc-arc -mmacosx-version-min=10.9 pdfwriter.m
cp uninstall.sh PDFfolder.png $PDFWRITERDIR/
gzip -c "$PPDFILE".ppd > $PPDDIR/"$PPDFILE".gz
ln -s /var/spool/pdfwriter pkgroot/Users/Shared/PDFwriter

chmod 700 $PDFWRITERDIR/pdfwriter
chmod 755 $PDFWRITERDIR/uninstall.sh # will be root:admin 750 after postinstall, but this will be ok if permissions are "repaired"
chmod 755 $PDFWRITERDIR/uninstall.sh # will be root:admin 750 after postinstall, but this will be ok if permissions are "repaired"
chmod 644 $PPDDIR/"$PPDFILE".gz

cp PDFWriter.iconset/icon_256x256.png resources/background.png
Expand All @@ -50,31 +49,27 @@ cp postinstall preinstall scripts/

echo "#### building installer package"

pkgbuild --root pkgroot --identifier au.rwts.pdfwriter --ownership recommended --scripts scripts --version 1.0 pdfwriter.pkg
pkgbuild --root pkgroot --identifier au.rwts.pdfwriter --ownership recommended --scripts scripts --version 1.0 pdfwriter.pkg > /dev/null

echo "#### building distribution file"
productbuild --synthesize --resources resources --product requirements --package pdfwriter.pkg distribution.dist
productbuild --synthesize --product requirements --package pdfwriter.pkg distribution.dist > /dev/null

sed -i '' '3 a\
\ <title>RWTS PDFwriter</title>\
\ <background file="background.png" alignment="bottomleft" scaling="none"/>\
\ <license file="License"/>
\ <license file="License"/>\
\ <readme file="README.rtfd" />
' distribution.dist

echo "#### building product"
productbuild --distribution distribution.dist --resources resources --product requirements product.pkg


# Have to add README to installer separately as productbuild can't handle rtfd resources
pkgutil --expand product.pkg expanded
sed -i '' '6 a\
\ <readme file="README.rtfd" />
' expanded/Distribution
productbuild --distribution distribution.dist --resources resources product.pkg > /dev/null

# We need to add README to installer separately as productbuild can't handle rtfd resources
pkgutil --expand product.pkg expanded
cp -r README.rtfd expanded/Resources/
pkgutil --flatten expanded RWTS-PDFwriter.pkg

if [ "$SIGNSTRING" ]; then echo "#### signing product"; productsign --sign "$SIGNSTRING" RWTS-PDFwriter.pkg ../RWTS-PDFwriter.pkg
if [ $SIGNSTRING ]; then echo "#### signing product"; productsign --sign $SIGNSTRING RWTS-PDFwriter.pkg ../RWTS-PDFwriter.pkg > /dev/null
else mv RWTS-PDFwriter.pkg ../RWTS-PDFwriter.pkg; fi

echo "#### cleaning up"
Expand Down
2 changes: 1 addition & 1 deletion sources/pdfwriter.m
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static int create_userdir(struct passwd *passwd, char *userdirname) {
}

// set icon for userdirname
[NSWorkspace.sharedWorkspace setIcon:[NSImage.alloc initByReferencingFile:@"/Library/Printers/RWTS/PDFwriter/PDFfolder.icns"] forFile:[NSString stringWithUTF8String:dirname] options:NSExcludeQuickDrawElementsIconCreationOption];
[NSWorkspace.sharedWorkspace setIcon:[NSImage.alloc initByReferencingFile:@"/Library/Printers/RWTS/PDFwriter/PDFfolder.png"] forFile:[NSString stringWithUTF8String:dirname] options:NSExcludeQuickDrawElementsIconCreationOption];


log_event(CPDEBUG, "output directory created", dirname);
Expand Down
3 changes: 3 additions & 0 deletions sources/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ chmod 750 /Library/Printers/RWTS/PDFwriter/uninstall.sh
# restart cupsd
launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist
launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist

# install printer
lpadmin -p PDFwriter -E -v pdfwriter:/ -P /Library/Printers/PPDs/Contents/Resources/RWTS\ PDFwriter.gz -o printer-is-shared=false
2 changes: 2 additions & 0 deletions sources/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Copyright 2010 Simone Karin Lehmann. All rights reserved.
# Modified 2016 Rodney I. Yager

lpadmin -x pdfwriter

sudo rm /Library/Printers/RWTS/PDFwriter/*
sudo rm /usr/libexec/cups/backend/pdfwriter
sudo rm /Library/Printers/PPDs/Contents/Resources/RWTS\ PDFwriter.gz
Expand Down

0 comments on commit 8cda9d7

Please sign in to comment.