Script to generate html and pdf versions of Next docs

NeXTComputers.org -> The Lounge

Title: Script to generate html and pdf versions of Next docs
Post by: barcher174 on January 06, 2015, 09:57:02 PM
All,

I've been experimenting with dumping out the Next developer documentation in other formats and thought I would share since a lot of these commands were new to me and seemingly pretty useful. I am copying over the .rtf files and then post processing them on the Mac. This will take a list of .rtf(d) files, convert the images (tiff and eps) to .png, and then dump both html and pdf formats.

Bash Script:

# Function to convert rtf to html & PDF
function convert {

mkdir $working_dir
cd $working_dir

#convert from rtf to html
textutil -convert html ../$current_file
mv ../*.html .
cp ../$current_file/*.eps .
cp ../$current_file/*.tiff .

#convert image files
echo ./*.eps | xargs -n1 pstopdf
sips -s format png ./*.pdf --out ./
sips -s format png ./*.tiff --out ./

#point to new image files in html
perl -p -i -e 's/\.eps/\.png/g' *
perl -p -i -e 's/\.tiff/\.png/g' *
perl -p -i -e 's/file:\/\/\///g' *

#clean up
rm -rf *.eps
rm -rf *.tiff
rm -rf *.pdf

#Save as PDF
cupsfilter *.html > $current_file.pdf

cd ../
rm -rf *.tiff
}

## Put your document info here

current_file=01_Planning.rtf
working_dir=01_html
convert

current_file=02_QuickStart.rtfd
working_dir=02_html
convert

etc....

#Combine the PDF files
"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o test.pdf */*.pdf

--
Brian
Title: Script to generate html and pdf versions of Next docs
Post by: gaspar on January 06, 2015, 10:40:53 PM
Are you planning to convert the document library then load them to here for future consumption?
I'm one of the (probably many) users that have no Mac nor can't afford a Mac.

Thanks
Title: Script to generate html and pdf versions of Next docs
Post by: barcher174 on January 06, 2015, 11:28:12 PM
Yes, my intent is to make these web accessable in the near future.
Title: Script to generate html and pdf versions of Next docs
Post by: gtnicol on January 07, 2015, 11:15:37 PM
Might be nice to produce an epub out of them as well?
Title: Script to generate html and pdf versions of Next docs
Post by: cuby on January 08, 2015, 11:21:44 AM
Some of the original NeXT manuals were converted to HTML and were available on channelu.com for quite some time, e.g. (mirror at cilinder.be):

http://www.cilinder.be/docs/next/NeXTStep/3.3/

I have no idea if these were converted by NeXT or somebody else. Would be nice to obtain the software used to do the conversion.

-- Michael
Title: Script to generate html and pdf versions of Next docs
Post by: Rob Blessin Black Hole on January 14, 2015, 01:59:23 AM
Quote from: "cuby"Some of the original NeXT manuals were converted to HTML and were available on channelu.com for quite some time, e.g. (mirror at cilinder.be):

http://www.cilinder.be/docs/next/NeXTStep/3.3/

I have no idea if these were converted by NeXT or somebody else. Would be nice to obtain the software used to do the conversion.

-- Michael

Hello: Yes I did contact both Randy and they guy hosting them as he is a forum member, I have permission to upload them here and will back up at Black hole but last conversation was on November 11 , 2014 . I'll ping him again  ! Best regards Rob Blessin

Go to top  Forum index