Exemple #1
0
 /**
  * Get REST response for lightning maps.
  *
  * @access public
  *
  * @param WP_REST_Request $request Current request.
  * @return WP_REST_Response $response Response for /satellite endpoint.
  */
 public function lightning(\WP_REST_Request $request)
 {
     // Prepare response with meta data and an array of lightning maps items
     $data = array('name' => 'Слике муња', 'id' => 'lightning-maps', 'type' => 'thumbnails', 'thumbnails' => Optimizer::optimize(Data::lightning()));
     $response = new \WP_REST_Response($data);
     return $response;
 }
$opt_settings->SetGrayScaleImageSettings($image_settings);
// use the same settings for both color and grayscale images
Optimizer::Optimize($doc, $opt_settings);
$doc->Save($output_path . $input_filename . "_opt2.pdf", SDFDoc::e_linearized);
$doc->Close();
//--------------------------------------------------------------------------------
// Example 3) Use monochrome image settings and default settings
// for color and grayscale images.
$doc = new PDFDoc($input_path . $input_filename . ".pdf");
$doc->InitSecurityHandler();
$mono_image_settings = new MonoImageSettings();
$mono_image_settings->SetCompressionMode(MonoImageSettings::e_jbig2);
$mono_image_settings->ForceRecompression(true);
$opt_settings = new OptimizerSettings();
$opt_settings->SetMonoImageSettings($mono_image_settings);
Optimizer::Optimize($doc, $opt_settings);
$doc->Save($output_path . $input_filename . "_opt3.pdf", SDFDoc::e_linearized);
$doc->Close();
// ----------------------------------------------------------------------
// Example 4) Use Flattener to simplify content in this document
// using default settings
$doc = new PDFDoc($input_path . "TigerText.pdf");
$doc->InitSecurityHandler();
$fl = new Flattener();
// The following lines can increase the resolution of background
// images.
//$fl->SetDPI(300);
//$fl->SetMaximumImagePixels(5000000);
// This line can be used to output Flate compressed background
// images rather than DCTDecode compressed images which is the default
//$fl->SetPreferJPG(false);
 /**
  * @brief CSS file 목록 return
  **/
 function _getCSSFile()
 {
     require_once _XE_PATH_ . "classes/optimizer/Optimizer.class.php";
     $oOptimizer = new Optimizer();
     return $oOptimizer->getOptimizedFiles($this->_getUniqueFileList($this->css_files), "css");
 }