static function insert_cached_document(CPDF_Adapter $pdf, $id, $new_page = true)
 {
     $res = self::__query("SELECT font_name FROM page_fonts WHERE id='" . pg_escape_string($id) . "'");
     while ($row = pg_fetch_assoc($res)) {
         $pdf->get_cpdf()->selectFont($row["font_name"]);
     }
     $res = self::__query("SELECT data FROM page_cache WHERE id='" . pg_escape_string($id) . "'");
     if ($new_page) {
         $pdf->new_page();
     }
     $first = true;
     while ($row = pg_fetch_assoc($res)) {
         if (!$first) {
             $pdf->new_page();
         } else {
             $first = false;
         }
         $page = $pdf->reopen_serialized_object($row["data"]);
         $pdf->add_object($page, "add");
     }
 }
 function get_cpdf() { return $this->_pdf->get_cpdf(); }
Пример #3
0
  static function insert_cached_document(CPDF_Adapter $pdf, $id, $new_page = true) {
    $res = self::__query("SELECT font_name FROM page_fonts WHERE id='" . pg_escape_string($id) . "'");

    // Ensure that the fonts needed by the cached document are loaded into
    // the pdf
    while ($row = pg_fetch_assoc($res))
      $pdf->get_cpdf()->selectFont($row["font_name"]);

    $res = self::__query("SELECT data FROM page_cache WHERE id='" . pg_escape_string($id) . "'");

    if ( $new_page )
      $pdf->new_page();

    $first = true;
    while ($row = pg_fetch_assoc($res)) {

      if ( !$first )
        $pdf->new_page();
      else
        $first = false;

      $page = $pdf->reopen_serialized_object($row["data"]);
      //$pdf->close_object();
      $pdf->add_object($page, "add");

    }

  }