| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Uwe Steinmann <Uwe.Steinmann@fernuni-hagen.de> |
+ | Rainer Schaaf <rjs@pdflib.com> |
+----------------------------------------------------------------------+
*/
php_info_print_table_start();
php_info_print_table_row(2, "PDF Support", "enabled" );
php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
- php_info_print_table_row(2, "CJK Font Support", "yes" );
- php_info_print_table_row(2, "In-memory PDF Creation Support", "yes" );
+ php_info_print_table_row(2, "Revision", "$Revision$" );
php_info_print_table_end();
}
PHP_MINIT_FUNCTION(pdf)
{
- le_pdf = zend_register_list_destructors_ex(_free_pdf_doc, NULL, "pdf document", module_number);
+ le_pdf = zend_register_list_destructors_ex(_free_pdf_doc, NULL, "pdf object", module_number);
/* this does something like setlocale("C", ...) in PDFlib 3.x */
PDF_boot();
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
PDF_set_info(pdf, field, Z_STRVAL_PP(arg2));
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
convert_to_string_ex(arg3);
}
pdf = PDF_new2(custom_errorhandler, pdf_emalloc, pdf_realloc, pdf_efree, NULL);
- PDF_set_parameter(pdf, "imagewarning", "true");
if(fp) {
if (PDF_open_fp(pdf, fp) < 0) RETURN_FALSE;
PDF_open_mem(pdf, pdf_flushwrite);
}
+ PDF_set_parameter(pdf, "imagewarning", "true");
+
ZEND_REGISTER_RESOURCE(return_value, pdf, le_pdf);
}
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_close(pdf);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_end_page(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
PDF_show(pdf, Z_STRVAL_PP(arg2));
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf object", le_pdf);
convert_to_string_ex(argv[1]);
convert_to_double_ex(argv[2]);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
- PDF_set_value(pdf, field, Z_DVAL_PP(arg2));
+ PDF_set_value(pdf, field, (float)Z_DVAL_PP(arg2));
RETURN_TRUE;
}
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
convert_to_double_ex(arg3);
- PDF_set_value(pdf, Z_STRVAL_PP(arg2), Z_DVAL_PP(arg3));
+ PDF_set_value(pdf, Z_STRVAL_PP(arg2), (float)Z_DVAL_PP(arg3));
RETURN_TRUE;
}
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf object", le_pdf);
convert_to_string_ex(argv[1]);
if(argc == 3)
if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "imagewidth"))) {
if(argc < 3) WRONG_PARAM_COUNT;
- value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET);
+ value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET);
} else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "imageheight"))) {
if(argc < 3) WRONG_PARAM_COUNT;
- value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET);
+ value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET);
} else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "resx"))) {
if(argc < 3) WRONG_PARAM_COUNT;
- value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET);
+ value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET);
} else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "resy"))) {
if(argc < 3) WRONG_PARAM_COUNT;
- value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET);
+ value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET);
} else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "font"))) {
value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), 0.0)+PDFLIB_IMAGE_OFFSET;
} else {
if(argc < 3) {
value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), 0.0);
} else {
- value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), Z_DVAL_PP(argv[2]));
+ value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2]));
}
}
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
font = (int) PDF_get_value(pdf, "font", 0);
RETURN_LONG(font+PDFLIB_FONT_OFFSET);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
fontname = (char *) PDF_get_parameter(pdf, "fontname", 0);
RETURN_STRING(fontname, 1);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
fontsize = PDF_get_value(pdf, "fontsize", 0);
RETURN_DOUBLE(fontsize);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
PDF_continue_text(pdf, Z_STRVAL_PP(arg2));
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
if (ZEND_NUM_ARGS() == 2) {
- font = PDF_get_value(pdf, "font", 0)+PDFLIB_FONT_OFFSET;
+ font = (int)PDF_get_value(pdf, "font", 0)+PDFLIB_FONT_OFFSET;
size = PDF_get_value(pdf, "fontsize", 0);
} else {
convert_to_long_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_save(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_restore(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
PDF_rotate(pdf, (float) Z_DVAL_PP(arg2));
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
/* pdflib will do this for you, will throw some exception
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_long_ex(arg2);
/* pdflib will do this for you, will throw some exception
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_long_ex(arg2);
/* pdflib will do this for you, will throw some exception
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
/* pdflib will do this for you, will throw some exception
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
PDF_setlinewidth(pdf, (float) Z_DVAL_PP(arg2));
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_closepath(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_closepath_stroke(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_stroke(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_fill(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_fill_stroke(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_closepath_fill_stroke(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_endpath(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_clip(pdf);
RETURN_TRUE;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
convert_to_string_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf object", le_pdf);
convert_to_string_ex(argv[1]);
if(argc == 3) {
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
PDF_setgray_fill(pdf, (float) Z_DVAL_PP(arg2));
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
PDF_setgray_stroke(pdf, (float) Z_DVAL_PP(arg2));
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
PDF_setgray(pdf, (float) Z_DVAL_PP(arg2));
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_long_ex(arg2);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
PDF_set_value(pdf, "duration", (float) Z_DVAL_PP(arg2));
{
zval **arg1, **arg2;
PDF *pdf;
- int pdf_image, *img;
+ int pdf_image;
char *image;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
}
/* {{{ proto int pdf_open_gif(int pdf, string giffile)
- Opens a GIF file and returns an image for placement in a PDF document */
+ Opens a GIF file and returns an image for placement in a pdf object */
PHP_FUNCTION(pdf_open_gif)
{
_php_pdf_open_image(INTERNAL_FUNCTION_PARAM_PASSTHRU,"gif");
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
convert_to_string_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
ZEND_FETCH_RESOURCE(im, gdImagePtr, arg2, -1, "Image", phpi_get_le_gd());
count = 3 * im->sx * im->sy;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_long_ex(arg2);
PDF_close_image(pdf, Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_long_ex(arg2);
convert_to_double_ex(arg3);
convert_to_double_ex(arg4);
convert_to_double_ex(arg5);
- PDF_place_image(pdf, Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET, (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), Z_DVAL_PP(arg5));
+ PDF_place_image(pdf, Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET, (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5));
RETURN_TRUE;
}
/* }}} */
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_long_ex(arg2);
- width = PDF_get_value(pdf, "imagewidth", Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET);
+ width = (int) PDF_get_value(pdf, "imagewidth", Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET);
RETURN_LONG(width);
}
/* }}} */
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_long_ex(arg2);
- height = PDF_get_value(pdf, "imageheight", Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET);
+ height = (int) PDF_get_value(pdf, "imageheight", Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET);
RETURN_LONG(height);
}
/* }}} */
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf object", le_pdf);
convert_to_double_ex(argv[1]);
convert_to_double_ex(argv[2]);
/* RJS: START OF NEW CODE */
-/* {{{ proto PDF *pdf_new()
+/* {{{ proto int pdf_new()
Creates a new PDF object */
PHP_FUNCTION(pdf_new) {
PDF *pdf;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
PDF_delete(pdf);
zend_list_delete(Z_LVAL_PP(arg1));
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
if (argc == 2) {
convert_to_string_ex(arg2);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
buffer = PDF_get_buffer(pdf, &size);
Prepares the font fontname for later use with pdf_setfont() */
PHP_FUNCTION(pdf_findfont) {
zval **arg1, **arg2, **arg3, **arg4;
- int id, embed, font;
+ int embed, font;
const char *fontname, *encoding;
PDF *pdf;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
fontname = Z_STRVAL_PP(arg2);
Sets the current font in the fiven fontsize */
PHP_FUNCTION(pdf_setfont) {
zval **arg1, **arg2, **arg3;
- int font, argc;
+ int font;
float fontsize;
PDF *pdf;
- if(argc != 3)
+ if(ZEND_NUM_ARGS() != 3)
WRONG_PARAM_COUNT;
if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE)
WRONG_PARAM_COUNT;
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_long_ex(arg2);
font = Z_LVAL_PP(arg2);
convert_to_double_ex(arg3);
fontsize = (float)Z_DVAL_PP(arg3);
- PDF_setfont(pdf, font+PDFLIB_FONT_OFFSET, fontsize);
+ PDF_setfont(pdf, font-PDFLIB_FONT_OFFSET, fontsize);
RETURN_TRUE;
}
/* {{{ proto void pdf_setpolydash(int pdfdoc, double darray)
Sets more complicated dash pattern */
-/* RJS: TODO: not yet working, dont know how to handle this pointer
- to an array ... maybe we have to ommit this from the interface ??? */
-
PHP_FUNCTION(pdf_setpolydash) {
zval **arg1, **arg2;
HashTable *array;
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_array_ex(arg2);
array = Z_ARRVAL_PP(arg2);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
PHP_FUNCTION(pdf_open_ccitt) {
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
PDF *pdf;
- int pdf_image, *img;
+ int pdf_image;
char *image;
if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7) == FAILURE) {
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
#ifdef VIRTUAL_DIR
PHP_FUNCTION(pdf_open_image) {
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8, **arg9, **arg10;
PDF *pdf;
- int pdf_image, *img;
- const char *image;
+ int pdf_image;
+ char *image;
if (ZEND_NUM_ARGS() != 10 || zend_get_parameters_ex(10, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10) == FAILURE) {
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_string_ex(arg2);
convert_to_string_ex(arg3);
PHP_FUNCTION(pdf_attach_file) {
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8, **arg9, **arg10;
PDF *pdf;
- int attach;
if (ZEND_NUM_ARGS() != 10 || zend_get_parameters_ex(10, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, &arg10) == FAILURE) {
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_long_ex(arg2);
convert_to_long_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7;
PDF *pdf;
- if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) {
+ if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7) == FAILURE) {
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);
WRONG_PARAM_COUNT;
}
- ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf document", le_pdf);
+ ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf);
convert_to_double_ex(arg2);
convert_to_double_ex(arg3);