-
Beispiele zu PDFlib werden kostenlos mitgeliefert
Auf den Downloadseiten von PDFlib GmbH kann man sich das entsprechende Paket für die iSeries herunterladen. In der ZIP Datei ist eine kurze Anleitung zur Installation vorhanden. In der Bibliothek PDFLIB ist dann auch eine QRPGLESRC mit entsprechenden Beispielen.
Code:
H DEBUG(*YES) DFTACTGRP(*NO) BNDDIR('PDFLIB/PDFLIB')
H COPYRIGHT('(C) PDFlib GmbH, Muenchen, Germany (www.pdflib.com)')
*********************************************************************************************
* Note: All strings passed into PDFlib are unicode strings with varying length.
* Use the %UCS2 build in function to convert a single byte string into a unicode string.
* All strings returned from PDFlib are unicode strings with varying length.
* Use the %CHAR build in function to convert a unicode string to a single byte string.
*********************************************************************************************
d/copy QRPGLESRC,PDFLIB
*********************************************************************************************
d p S *
d font s 10i 0
d error s 50
d filename s 256
d n s 1c varying inz(%ucs2(''))
*********************************************************************************************
c clear error
*
* Init on PDFlib
c eval p=RPDF_new
c if p=*null
c eval error='Couldn''t create PDFlib object '+
c '(out of memory)Ü'
c exsr exit
c endif
*
* Open new pdf file
c if RPDF_begin_document(p:
c %ucs2('hello.pdf'):n) = -1
c exsr geterrmsg
c exsr exit
c endif
* Set info "Creator"
c callp RPDF_set_info(p:%ucs2('Creator'):
c %ucs2('hello.rpg'))
* Set info "Author"
c callp RPDF_set_info(p:%ucs2('Author'):
c %ucs2('Thomas Merz'))
* Set info "Title"
c callp RPDF_set_info(p:%ucs2('Title'):
c %ucs2('Hello, world (RPG)Ü'))
* Start a new page
c callp RPDF_begin_page_ext(p:a4_width:a4_height:n)
* Unicode Encoding
c eval font=RPDF_load_font(p:
c %ucs2('Helvetica-Bold'):
c %ucs2('unicode'):n)
*
c callp RPDF_setfont(p:font:24)
c callp RPDF_set_text_pos(p:50:700)
* Write unicode text constants
c callp RPDF_show(p:%ucs2('Hello worldÜ'))
*
c callp RPDF_continue_text(p:
c %ucs2('(says ILE RPG in unicode)'))
* Close page
c callp RPDF_end_page_ext(p:n)
* Close PDF document
c callp RPDF_end_document(p:n)
* Delete the PDF object
c callp RPDF_delete(p)
*
c exsr exit
*********************************************************************************************
c geterrmsg begsr
c eval error=%char(RPDF_get_errmsg(p))
c endsr
*********************************************************************************************
c exit begsr
c if error<>*blanks
c eval error='Error: '+error
c error dsply
c endif
c seton lr
c return
c endsr
Similar Threads
-
By linguin in forum NEWSboard Linux
Antworten: 0
Letzter Beitrag: 03-01-07, 08:22
-
By Kilianski in forum NEWSboard Server Software
Antworten: 0
Letzter Beitrag: 22-11-06, 15:23
-
By jo400 in forum IBM i Hauptforum
Antworten: 1
Letzter Beitrag: 21-10-06, 17:57
-
By cami in forum IBM i Hauptforum
Antworten: 3
Letzter Beitrag: 27-08-06, 17:31
-
By Key in forum IBM i Hauptforum
Antworten: 4
Letzter Beitrag: 12-06-06, 12:29
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- You may not post attachments
- You may not edit your posts
-
Foren-Regeln
|
Erweiterte Foren Suche
Google Foren Suche
Forum & Artikel Update eMail
AS/400 / IBM i
Server Expert Gruppen
Unternehmens IT
|
Kategorien online Artikel
- Big Data, Analytics, BI, MIS
- Cloud, Social Media, Devices
- DMS, Archivierung, Druck
- ERP + Add-ons, Business Software
- Hochverfügbarkeit
- Human Resources, Personal
- IBM Announcements
- IT-Karikaturen
- Leitartikel
- Load`n`go
- Messen, Veranstaltungen
- NEWSolutions Dossiers
- Programmierung
- Security
- Software Development + Change Mgmt.
- Solutions & Provider
- Speicher – Storage
- Strategische Berichte
- Systemmanagement
- Tools, Hot-Tips
Auf dem Laufenden bleiben
|
Bookmarks