Api

PrintTask

{note} You're browsing the documentation for an old version of laravel-printing. Consider upgrading your project to v3. Check your version with the following command:

composer show rawilk/laravel-printing

Rawilk\Printing\PrintTask

/**
 * Set the content to be printed. 
 *
 * @param string $content
 * @return PrintTask 
 */
public function content($content): self;
/**
 * Set the path to a pdf file to be printed. 
 *
 * @param string $filePath
 * @return PrintTask
 */
public function file(string $filePath): self;
/**
 * Set a url to be printed.
 *
 * @param string $url
 * @return PrintTask
 */
public function url(string $url): self;
/**
 * Set the title of the print task.
 * Defaults to a randomly generated id.
 *
 * @param string $jobTitle
 * @return PrintTask
 */
public function jobTitle(string $jobTitle): self;
/**
 * Set the id of the printer to print to. This method must be called
 * when printing. 
 *
 * @param \Rawilk\Printing\Contracts\Printer|string|null|int $printerId
 * @return PrintTask
 */
public function printer(Printer|string|null|int $printerId): self;
/**
 * Set a source of the print task. Defaults to the application name.
 *
 * @param string $printSource
 * @return PrintTask
 */
public function printSource(string $printSource): self;
/**
 * Add tags to the task if your driver supports it. 
 *
 * @param string|array|mixed $tags
 * @return PrintTask 
 */
public function tags($tags): self;
/**
 * Set a tray to print to if your printer and driver support it.
 *
 * @param string $tray
 * @return PrintTask
 */
public function tray($tray): self;
/**
 * Set the amount of copies to print.
 *
 * @param int $copies
 * @return PrintTask
 */
public function copies(int $copies): self;
/**
 * Set the page range to print.
 * Omit $end to start at a page and continue to the end. 
 *
 * @param int|string $start
 * @param int|null @end
 * @return PrintTask
 */
public function range($start, $end = null): self;
/**
 * Set an option for the print task that your driver supports.
 *
 * @param string $key
 * @param mixed $value
 * @return PrintTask
 */
public function option(string $key, $value): self;
/**
 * Send the print task to your print server. 
 * If successful, it will return a PrintJob instance.
 *
 * @return PrintJob 
 */
public function send(): PrintJob;
Previous
Printer
Caught a mistake? Suggest an edit on GitHub