SetTitle: Set Title Property [ 27 ]
Description
Set Title property in PDF document – truncated to 64 characters if longer. This function overrides the initial Title value found in configuration file taken into account when NewPdfy() function is invoked. It takes one parameter which is a pointer to a string containing the required Title property value.
C calling syntax
void SetTitle (char *pt_Title)
Cobol calling syntax
Call "SetTitle" using by value Pt_Title.
C sample code
#include "fpdf.h" static char f_ini ??(??) = ??< "ini??/??/demofpdf.ini" ??>; static char f_out ??(??) = ??< "pdf??/??/demo_c.pdf" ??>; /* ----------------------------------------------------------------- */ int main (int argc, char *argv []) ??< NewPdfy (f_ini, 1); SetCompression (false); AddPage("P"); SetFont ("Times", "B", 24); Text (20, 25, "FPDF4ZOS for mass production #1"); AddPage("P"); SetFont ("Times", "B", 24); Text (20, 25, "FPDF4ZOS for mass production #2"); SetAuthor ("GMK - inspired by PHP fpdf package"); SetCreator ("Creator for FPDF4ZOS basics"); SetTitle ("Title for FPDF4ZOS basics"); SetSubject ("Subject for FPDF4ZOS basics"); SetKeywords ("FPDF4ZOS,Basics,GMK,Aba,Ima"); SetDisplayMode ("fullpage", "two", "0"); FlushPdf (f_out, 2, "CUSTOMER", "demo_c"); ??>
Cobol sample code
Procedure division. Set Pt0 to Address of T0. Set Pt1 to Address of T1. Set Pt2 to Address of T2. * String 'DD:FINI' Low-Value delimited by size into T0. Move 2 to I. Call "NewPdfy" Using by value Pt0, I returning PdfRC. * Move 0 to FLAG. Call "SetCompression" Using by value FLAG. String 'P' Low-Value delimited by size into T0. Call "AddPage" Using by value Pt0. * Move 20 to W. String 'Arial' Low-Value delimited by size into T0. String 'N' Low-Value delimited by size into T1. Call "SetFont" Using by value Pt0, Pt1, W. * String 'FPDF4ZOS for mass production' Low-Value delimited by size into T0. Move 20 to X. Move 25 to Y. Call "Text" Using by value X, Y, Pt0. * String 'GMK - inspired by PHP fpdf package' Low-Value delimited by size into T0. Call "SetAuthor" Using by value Pt0. String 'Creator for FPDF4ZOS basics' Low-Value delimited by size into T0. Call "SetCreator" Using by value Pt0. String 'Title for FPDF4ZOS basics' Low-Value delimited by size into T0. Call "SetTitle" Using by value Pt0. String 'Subject for FPDF4ZOS basics' Low-Value delimited by size into T0. Call "SetSubject" Using by value Pt0. String 'FPDF4ZOS,Basics,GMK,Aba,Ima' Low-Value delimited by size into T0. Call "SetKeywords" Using by value Pt0. * String 'fullpage' Low-Value delimited by size into T0. String 'two' Low-Value delimited by size into T1. String '0' Low-Value delimited by size into T2. Call "SetDisplayMode" Using by value Pt0,Pt1,Pt2. * Move 2 to Flag. String 'DD:FOUT' Low-Value delimited by size into T0. String 'CUSTOMER' Low-Value delimited by size into T1. String 'DEMOCBL0' Low-Value delimited by size into T2. Call "FlushPdf" using by value Pt0, FLAG, Pt1, Pt2 *
Description of sample code
This piece of code illustrates the properties setting functions found in FPDF4ZOS interface. It opens a PDF context, inserts a page, configures a font, writes a short string, set miscellanous properties of document and flushes result on a PDF file. - NewPdfy() --> Initialisation of a pdf context - AddPage() --> As it says - SetFont() --> set current font - Text() --> Write a piece of Text at position [x,y] - SetCompression() --> Instructs that PDF streams will not be compressed - SetAuthor() --> Set Author property within PDF document - SetSubject() --> Set Subject property within PDF document - SetCreator() --> Set Creator property within PDF document - SetTitle() --> Set Title property within PDF document - SetKeywords() --> Set Keywords property within PDF document - SetDisplayMode() --> Set Initial display behavior upon opening the PDF document - FlushPdf() --> Output PDF file taking into account all the instructions invoked since NewPdfy or previous FlushPdf
See sample source code in 'C' as well as PDF execution result - NB: For encrypted PDFs, user password is USER-PSWD