witam wszystkich mam nastepujacy problem - chcialbym przy pomocy pdflib zaimportowac juz istniejacego pdf'a (jest w nim czytsty tekst - hello.pdf) do mojego nowego pdf'a ( w krotym maja byc wypisane w tym przykladzie polskie litery - inna sprawa ze po wielu probach nie moge uzyskac polskiej czcionki). Zamiast zaimprtowanego pliku otrzymuje ramke w nowym pdf'ie ktorej co ciekawe nie mam w importowanym pliku - czy ktos moze spotkal sie problemem importu?

oto kod:
  1. <?php
  2.  
  3.     // zaladowanie pliku z funkcjami (np. ZapisDoPliku)
  4.     include(&#092;"inc/function.inc\");
  5.  
  6.     // zaladowanie biblioteki odpowiedzialnej za obsluge formatu PDF
  7.     dl(&#092;"libpdf_php.dll\");
  8.     
  9.     // ***********************************
  10.     
  11.     $p = pdf_new();
  12.     
  13.     // stworzenie nowego pliku typu PDF
  14.     pdf_open_file($p,&#092;"\");
  15.     
  16.     // Open an existing PDF document and prepare it for later use. 
  17.     // RETURN: PDI document identifier
  18.     $pdi = pdf_open_pdi($p, &#092;"hello.pdf\", \"\", 0);
  19.     // read values
  20.     $page = pdf_open_pdi_page($p, $pdi, 1, &#092;"\");
  21.     $width = pdf_get_pdi_value($p, &#092;"width\", $pdi, $page, 0);
  22.     $height = pdf_get_pdi_value($p, &#092;"height\", $pdi, $page, 0);
  23.     
  24.     pdf_begin_page($p,$width,$height);
  25.  
  26.     // na razie dodaje wylacznie ramke bez tekstu
  27.     pdf_place_pdi_page($p,$page,0.0,0.0,1.0,1.0);
  28.     
  29.     // dodanie tekstu
  30.     $font = PDF_load_font($p, &#092;"Arial\", \"iso8859-16\", \"\");    
  31.     // Set the current font in the specified size
  32.     PDF_setfont($p, $font, 24.0);    
  33.     // Set the position for text output on the page
  34.     pdf_show_xy($p, &#092;"±êæó¶³¿¼\", 100, 500);
  35.     
  36.     pdf_close_pdi_page($p,$page);
  37.     
  38.     pdf_end_page($p);
  39.     pdf_close($p);
  40.  
  41.     $buf = PDF_get_buffer($p);
  42.  
  43.     $nazwaPliku = &#092;"nowy_z_szablonu.pdf\";
  44.     
  45.     if (!ZapisDoPliku($nazwaPliku,$buf)) echo &#092;"<br><b>Niepowodzenie ZapisDoPliku</b><br>\";
  46.     else echo 'Wygenerowany dokument zapisalem do pliku'.&#092;" \"$nazwaPliku\" \";
  47.     PDF_delete($p);
  48. ?>


OKEJ juz dziala, zostawiam informacje dla przyszlych pokolen, cytat z manuala:

Cytat
File name handling in php. Unqualified file names (without any path component) and
relative file names for PDF, image, font and other disk files are handled differently in
Unix and Windows versions of php:
> php on Unix systems will find files without any path component in the directory
where the script is located.
> php on Windows will find files without any path component only in the directory
where the php DLL is located.
In order to provide platform-independent file name handling use of PDFlib’s Search-
Path facility (see Section 3.1.6, &raquo;Resource Configuration and File Searching&laquo;, page 51) is
strongly recommended.


polecam dokladna sciezke dostepu :-)