Advertisement
Advertisement
| 06.12.2008 at 04:54PM PDT, ID: 23481461 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: |
This is the code I have created so far :
/**
*
*/
public static function createPreview($_file, $_noise_image) {
// the preview
$preview_file = dirname($_file) . "/" . "preview_" . basename($_file);
// create handle for new PDF document
$pdf_handler = pdf_new();
// open a file
pdf_open_file($pdf_handler, $preview_file);
// insert the previews
$images = new Imagick($_file);
//
foreach ($images as $k => $image) {
$preview_jpeg = dirname($_file) . "/" . "tmp_page" . $k . '_.jpg';
$image->setImageFormat("jpg");
$image->writeImage($preview_jpeg);
// start a new page (A4)
pdf_begin_page($pdf_handler, 595, 842);
$pdfimage = pdf_load_image($pdf_handler, "jpeg", $preview_jpeg, "");
pdf_place_image($pdf_handler, $pdfimage, 0, 0, 1);
// place the noise image : TODO
// end page (A4)
pdf_end_page($pdf_handler);
// clean
@unlink($preview_jpeg);
//$image->clear();
//$image->destroy();
}
// close and save file
pdf_close($pdf_handler);
//
return $preview_file;
}
|