PHP Doku:: Reads an external file with raw PostScript code -

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzNon-Text MIME-AusgabenPostScript document creationPS Funktionenps_include_file

Ein Service von Reinhard Neidl - Webprogrammierung.

PS Funktionen




(PECL ps >= 1.3.4)

ps_include_fileReads an external file with raw PostScript code


bool ps_include_file ( resource $psdoc , string $file )


Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Argumente zur Verfügung.



Resource identifier of the postscript file as returned by ps_new().



Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben.

2 BenutzerBeiträge:
- Beiträge aktualisieren...
php at catchall dot toao dot net
16.06.2009 21:46
I wanted to print to a specific tray of my printer, a Dell 3110cn.  Some printers allow you to specify in their config what tray will be used as a default tray, but my printer doesn't.  Googling told me that printing to a specific tray is not a function of PostScript but rather a function of my printer itself.  So, I had to find the function for my specific printer.  I located a PPD file for my printer.  Purely by luck (I searched through the file for the word 'tray') I found the following:

*InputSlot 2ndTray-H/Tray 2 (500 Sheets): "
  3 dict begin
  /MediaPosition 1 def
  /DeferredMediaSelection true def
  /TraySwitch false def
  currentdict end setpagedevice
" *End
I saved this as a file named, without the first and last lines, and with a blank line at the end.  Then I used the following command in my program:

<?php ps_include_file($ps, ''); ?>

It worked!
lindsay at dingos dot net
14.03.2008 15:43
This method allows you to insert raw postscript at any point in the postscript document.
You can use this function to include 'Barcodes in pure PostScript' in the prolog of your postscript document, and then create a temporary file that contains the necessary postscript to actually call the barcode generating postscript function at whatever point in your document you want it to appear.

it would be nice if there was an alternate form of this function that allowed you to just insert the raw postscript other than make a temporary file to be opened by the function.

PHP Powered Diese Seite bei
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)