![]() Create GUI for Downloading Youtube Video using Python.Pytube | Python library to download youtube videos.Python | Download YouTube videos using youtube_dl module.YouTube Media/Audio Download using Python – pafy.Hyperlink Induced Topic Search (HITS) Algorithm using Networxx Module | Python.Expectation or expected value of an array.Expected Number of Trials until Success.Convert Text and Text File to PDF using Python.Extract text from PDF File using Python.Python | Reading contents of PDF using OCR (Optical Character Recognition).Project Idea | ( Character Recognition from Image ).Project Idea | (Detection of Malicious Network activity).Project Idea | (Online Course Registration).Project Idea | (Project Approval System).ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.i guess it was for written for Letter output)ĭecompress the "/Library/Printers/PPDs/Contents/Resources/en.lproj/HP LaserJet 8150 Series.gz" rename the ppd to "HP8150_H.PPD" and place it in "/usr/share/cups/model/" - now hup the cups daemon again with "sudo killall -HUP cupsd" go to the web interface and you are able to chose this printer. Īs an example i take the LaserJet 8150 ppd as it worked for me with the pdf backend and produced nice pdf output (centered) unlike the generic one i used before (capped the top of the page as i used the format A4. or to have an alternative installation wayĪs on macos x the pre-installed ppds that come in the web interface (good ones are placed in other directorys accessible only by print-center) arent suitable for the pstopdf conversion you have to copy them over. or want to play around with the web interface of cups. #!/bin/sh# Michael Goffioul# Updated by P T Withington for Mac OS XLOGFILE=/tmp/pdf.logGSBIN=`which pstopdf`FILENAME=echo "Executable: $GSBIN" > $LOGFILEecho "Arguments: |$1|$2|$3|$4|$5|$6|" > $LOGFILE# case of no argument, prints available URIsif then if then exit 0 fi echo "direct pdf \"Unknown\" \"PDF Writing\"" exit 0fi# case of wrong number of argumentsif then echo "Usage: pdf job-id user title copies options " exit 1fi# get PDF directory from device URI, and check write statusPDFDIR=$_$I.PDF" I=$I+1doneecho "Output file name: $OUTPUTFILENAME" > $LOGFILE# run ghostscriptif then $GSBIN $6 -o $OUTPUTFILENAME > $LOGFILEelse $GSBIN -i -o $OUTPUTFILENAME > $LOGFILEfi# modify ownership and permissions on the file# - world readable# - owns to user specified in argumentchmod a+r $OUTPUTFILENAMEif then chown $2 $OUTPUTFILENAMEfiexit 0įor those that cant use the print-center. The script creates a log file ( /tmp/pdf.log) each time it prints, which might be helpful if something goes wrong. For the printer model, select Adobe (if you installed the Distiller PPD in step three above), otherwise leave it as Generic. For the device URI, use pdf://pathname, where pathname is where you would like the PDF file to be saved - /tmp is a good choice as it gets cleaned out automatically when you restart. Give it a descriptive name (e.g., PDF Writer). Hold down Option and click on the Add button. Restart the CUPS daemon, so it finds your new backend and model ( sudo killall -HUP cupsd)Now you can configure your virtual printer using the Printer Setup Utility.(Optional) If you have the Acrobat Distiller PPD, put a copy in /usr/share/cups/model.Make it executable by everyone: % sudo chmod a+x /usr/libexec/cups/backend/pdf.Copy the included script (in the main body of the hint) to /usr/libexec/cups/backend/pdf.Here's what you need to do (in a Terminal): There are a few differences for Mac OS X, so I've modified his original script to fit. I found an article by Michael Goffiou that gave a simple shell script that would create a 'backend' for CUPS that does the trick. I suspected there was a simple way to do this with CUPS (the printing architecture underlying OS X). I know that you can always select Save as PDF when printing, but I had a situation where I wanted to be able to print to PDF without having to go through the Print dialog.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |