function _control_font()
 {
     return pdf_load_font($this->pdf, "Helvetica", "winansi", "embedding=true subsetting=false");
 }
Ejemplo n.º 2
0
    message(__FILE__, __LINE__, 'error', '[b]Error[/b][br]album_id not found in database');
}
$query = mysql_query('SELECT image_front, image_back, image_front_width * image_front_height AS front_resolution, album_id
	FROM bitmap
	WHERE album_id = "' . mysql_real_escape_string($album_id) . '"');
$bitmap = mysql_fetch_assoc($query);
//  +------------------------------------------------------------------------+
//  | Initialize PDF                                                         |
//  +------------------------------------------------------------------------+
$pdf = pdf_new();
if (pdf_get_value($pdf, 'major', 0) < 5) {
    pdf_close($pdf);
    message(__FILE__, __LINE__, 'error', '[b]netjukebox requires PDFlib 5 or later[/b]');
}
pdf_open_file($pdf, '');
$font = pdf_load_font($pdf, 'Helvetica', 'host', '');
// winansi, host, iso8859-1, unicode >> unicode and glyph id addressing not supported in PDFlib Lite!!!
if (NJB_DEFAULT_CHARSET == 'UTF-8') {
    pdf_set_parameter($pdf, 'textformat', 'utf8');
}
pdf_set_info($pdf, 'Creator', 'netjukebox ' . NJB_VERSION);
pdf_set_info($pdf, 'Title', $album['artist'] . ' - ' . $album['album']);
$width = 210;
// A4
$height = 297;
// A4
$scale = 72 / 25.4;
// mm to dtp-point (1 point = 1/72 inch; 1 inch = 25.4 mm)
$hash_data = pdf_get_value($pdf, 'major', 0) . '-' . pdf_get_value($pdf, 'minor', 0) . '-' . NJB_VERSION;
$hash_data .= '-' . $album['artist'] . ' - ' . $album['album'] . '-' . $width . '-' . $height;
pdf_begin_page($pdf, $width * $scale, $height * $scale);