public cat ( integer | string | array $start, integer | string | null $end = null, string | null $handle = null, string | null $qualifier = null, string $rotation = null ) : |
||
$start | integer | string | array | the start page number or an array of page numbers. If an array, the other arguments will be ignored. $start can also be bigger than $end for pages in reverse order. |
$end | integer | string | null | the end page number or null for single page (or list if $start is an array) |
$handle | string | null | the handle of the file to use. Can be null if only a single file was added. |
$qualifier | string | null | the page number qualifier, either 'even' or 'odd' or null for none |
$rotation | string | the rotation to apply to the pages. |
return | the pdf instance for method chaining |
public function cat($start, $end = null, $handle = null, $qualifier = null, $rotation = null)
{
$this->getCommand()->setOperation('cat')->addPageRange($start, $end, $handle, $qualifier, $rotation);
return $this;
}
public function dosplit(Request $request) { $print_element = Element::where('subject_lesson_id', $request->subject_lesson_id)->where('title', 'نسخة للطباعة')->first(); if (!$print_element) { $print_element = new Element(); $print_element->title = 'نسخة للطباعة'; $print_element->element_order = 10; $print_element->state = 'نشط'; $print_element->type = 'pdf'; $print_element->subject_lesson_id = $request->subject_lesson_id; $print_element->file = $request->file('file'); $print_element->save(); } foreach ($request->subject_element_title as $key => $value) { if ($request->element_start_page[$key]) { $elelment = new Element(); $fonly = uniqid() . time() . '.pdf'; $filename = public_path() . '/temp/' . $fonly; $elelment->title = $value; $elelment->element_order = $request->element_order[$key]; $elelment->state = 'نشط'; $elelment->type = 'pdf'; $elelment->subject_lesson_id = $request->subject_lesson_id; $pdf = new Pdf($print_element->file->path()); $pdf->cat($request->element_start_page[$key], $request->element_end_page[$key]); $pdf->saveAs($filename); // sleep(8); $elelment->file = $filename; // $elelment->file = 'https://el-css.edu.om/admin/public/temp/'.$fonly; $elelment->save(); } } $message = 'تم اضافة العناصر بنجاح'; return redirect()->route('s.elements.index', array('id' => $request->subject_lesson_id))->with('success', $message); }