php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #1033 Encoding in PDF is not used in any way
Submitted: 1999-01-06 06:40 UTC Modified: 1999-01-11 08:53 UTC
From: sami at iqs dot fi Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 3.0.6 OS: Linux
Private report: No CVE-ID: None
 [1999-01-06 06:40 UTC] sami at iqs dot fi
The documentation states for the PDF_set_font()-function that the encoding-parameter should be given as a string. The string however is not used in any way in PHP. That causes problems with skandinavian alphabets. I have made a little change to PHP, which makes PHP expect an integer as the encoding-parameter (like pdflib does) and uses it as the encoding method. This works well and now I'm able to create PDF files that have skandinavian alphabets in them.

Here is a unified diff to do the thing I did:

--- functions/pdf.c   Wed Jan  6 13:37:08 1999
+++ functions/pdf.c       Wed Jan  6 13:37:54 1999
@@ -511,7 +511,7 @@
 }
 /* }}} */

-/* {{{ proto void pdf_set_font(int pdfdoc, string font, double size, string encoding)
+/* {{{ proto void pdf_set_font(int pdfdoc, string font, double size, int encoding)
    Select the current font face and size */
 void php3_pdf_set_font(INTERNAL_FUNCTION_PARAMETERS) {
        pval *arg1, *arg2, *arg3, *arg4;
@@ -526,7 +526,7 @@
        convert_to_long(arg1);
        convert_to_string(arg2);
        convert_to_double(arg3);
-       convert_to_string(arg4);
+       convert_to_long(arg4);
        id=arg1->value.lval;
        pdf = php3_list_find(id,&type);
        if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
@@ -534,7 +534,7 @@
                RETURN_FALSE;
        }

-       PDF_set_font(pdf, arg2->value.str.val, (float) arg3->value.dval, builtin);
+       PDF_set_font(pdf, arg2->value.str.val, (float) arg3->value.dval, arg4->value.lval);

        RETURN_TRUE;
 }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-01-11 08:53 UTC] steinm
encoding can now be set 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 09:01:32 2024 UTC