with Text_IO; with Gnu.PDF; with Ada.Exceptions; procedure Test_PDF is use Gnu.PDF; P : PDF_Handle; Font : PDF_Font; procedure Make_White_Star (X, Y : in Float) is begin PDF_Setcolor (+P, +"both", +"rgb", 1.0, 1.0, 1.0, 0.0); PDF_Moveto (+P, X+7.0, Y+11.0); PDF_Lineto (+P, X+4.0, Y+1.0); PDF_Lineto (+P, X+13.0, Y+6.0); PDF_Lineto (+P, X+2.0, Y+6.0); PDF_Lineto (+P, X+12.0, Y+1.0); PDF_Closepath_Fill_Stroke (+P); end; begin if PDF_Open_File(+P, +"flag.pdf" ) = -1 then Text_IO.Put_Line(Text_IO.Standard_Error,"ERROR:cannot create pdf."); end if; PDF_Set_Info(+P, +"Creator", +"GNU.PDF"); PDF_Set_Info(+P, +"Author", +("USA" & " flag")); -- how to concatenate PDF_Set_Info(+P, +"Title", +"Ada Test Program"); PDF_Begin_Page(+P, 8.5*Inches, 11.0*Inches); -- start a new page Font := PDF_Findfont(+P, +"Helvetica-Bold", +"host", 0); PDF_Setfont (+P, Font, 24.0); PDF_Set_Text_Pos (+P, 1.0, Letter_Height - 24.0); -- in points PDF_Show (+P, +"Stars and Stripes"); PDF_Continue_Text (+P, +"... test PDF"); PDF_Setcolor (+P, +"both", +"rgb", 1.0, 0.0, 0.0, 0.0); PDF_Save(+P); PDF_Translate (+P, 50.0, 400.0); for Y in 1 .. 7 loop PDF_Rect (+P, 1.0, 30.0*Float(Y-1) + 1.0, 320.0, 15.0); PDF_Fill_Stroke (+P); end loop; PDF_Setcolor (+P, +"both", +"rgb", 0.0, 0.0, 1.0, 0.0); PDF_Rect (+P, 1.0, 91.0, 122.0, 105.0); PDF_Fill_Stroke (+P); for X in 0 .. 5 loop for Y in 0 .. 4 loop Make_White_Star (Float(X)*20.0+5.0, Float(Y)*21.0+96.0); end loop; end loop; for X in 0 .. 4 loop for Y in 0 .. 3 loop Make_White_Star (Float(X)*20.0+15.0, Float(Y)*21.0+106.0); end loop; end loop; PDF_Restore (+P); PDF_End_Page (+P); Text_IO.Put_Line ("encode=" & PDF_Get_Parameter(+P, +"fontencoding", 0.0)); PDF_Close(+P); PDF_Shutdown; exception when E : others => Text_IO.Put_Line ("FATAL : " & Ada.Exceptions.Exception_Information(E)); end; with Interfaces.C.Strings; with Text_IO; package body Gnu.PDF is function "+"(Str : String) return P_String is begin return P_String (Str & ASCII.Nul); end; function "-"(Str : P_String) return String is begin for I in Str'Range loop if Str(I) = ASCII.Nul then return String (Str(Str'First..I-1)); end if; end loop; return String (Str); end; function PDF_get_parameter( p : access PDF; key : P_String; modifier: P_Float) return string is use Interfaces.C.Strings; function PDF_get_parameter( p : access PDF; key : P_String; modifier: P_Float) return Chars_Ptr; pragma Import(C, PDF_get_parameter, "PDF_get_parameter"); Chars : Chars_Ptr; begin Chars := PDF_get_parameter (P, Key, Modifier); if Chars = Null_Ptr then return ""; else return Value (Chars); end if; end; function PDF_get_buffer( p : access PDF; size: access Long_Integer) return String is use Interfaces.C.Strings; function PDF_get_buffer( p : access PDF; size: access Long_Integer) return Chars_Ptr; pragma Import(C, PDF_get_buffer, "PDF_get_buffer"); Chars : Chars_Ptr; begin Chars := PDF_Get_buffer (P, Size); if Chars = Null_Ptr then return ""; else return Value (Chars); end if; end; procedure Default_Error (p : access PDF; Error : Error_Type; Msg : P_String); pragma Convention (C, Default_Error); procedure Default_Error (p : access PDF; Error : Error_Type; Msg : P_String) is Err : constant String := -Msg & " # " & Error_Type'Image(Error); begin Text_IO.Put_Line (Text_IO.Standard_Error, Err); if Error = PDF_Nonfatal_Error then return; else raise Pdf_Error; end if; end; procedure Initialize (Handle : in out Pdf_Handle) is begin Handle.Obj := PDF_new2 (Default_Error'Access); PDF_set_parameter (Handle.Obj, +"binding", +"Ada"); end; procedure Finalize (Handle : in out Pdf_Handle) is begin PDF_delete (Handle.Obj); end; function "+" (Handle : PDF_Handle) return PDF_Access is begin return Handle.Obj; end; begin PDF_boot; end; with Interfaces.C_Streams; with Ada.Finalization; with System; ---------------------------------------------------- package Gnu.PDF is --- Reference package API for generating dynamic PDF ---------------------------------------------------- pragma Elaborate_Body; PDF_Error : exception; subtype P_Int is Integer; subtype P_Float is Float; type P_String is new String; function "-"(Str : P_String) return String; -- Strips ASCII.NUL terminator function "+"(Str : String) return P_String; -- Adds ASCII.NUL terminator -- PDF exceptions that could be handled via the user-supplied error handler type Error_Type is (PDF_None, -- will never happen PDF_Memory_Error, PDF_IO_Error, PDF_Runtime_Error, PDF_Index_Error, PDF_Type_Error, PDF_Division_By_Zero, PDF_Overflow_Error, PDF_Syntax_Error, PDF_Value_Error, PDF_System_Error, PDF_Nonfatal_Error, PDF_Unknown_Error); -- TYPES type PDF is limited private; type PDF_Access is access all PDF; type PDF_File is new P_Int; type PDF_Font is new P_Int; type PDF_Image is new P_Int; type PDF_Bookmark is new P_Int; -- CONTROLLED TYPE type PDF_Handle is new Ada.Finalization.Limited_Controlled with private; procedure Initialize (Handle : in out PDF_Handle); procedure Finalize (Handle : in out PDF_Handle); function "+" (Handle : PDF_Handle) return PDF_Access; -- CALLBACKS type Write_proc is access function( p : access PDF; data : String; size : Integer) return Integer; pragma Convention (C, Write_proc); type Error_proc is access procedure (p : access PDF; Error : Error_Type; Msg : P_String); pragma Convention (C, Error_proc); -- MAIN LIBRARY ROUTINES -- Gets PDF lib major version numeral . function PDF_get_majorversion return Integer; -- Gets PDF lib minor version numeral . function PDF_get_minorversion return P_Int; -- Boots PDF lib procedure PDF_boot; -- Shuts down PDF lib procedure PDF_shutdown; -- Generates new PDF object with client-supplied error handling and memory -- allocation routines. function PDF_new2 (error : Error_proc; alloc, realloc, free : System.Address := System.Null_Address; opaque : System.Address := System.Null_Address) return PDF_Access; -- Get opaque application pointer saved in PDF lib -- for multi-threading. -- Extra threading info allocated via PDF_new2 if needed function PDF_get_opaque( p: access PDF) return System.Address; -- Generates new PDF object, utilize default error handling and memory management. function PDF_new return PDF_access; -- Deletes PDF object and deallocate every internal resources. procedure PDF_delete( p: access PDF); -- Generates new PDF file utilizing the supplied file name. function PDF_open_file( p : access PDF; file_name: P_String) return PDF_File; -- Opens new PDF file associated with p, utilize the supplied file handle. function PDF_open_fp( p : access PDF; fp: Interfaces.C_Streams.FILEs) return PDF_File; -- Opens new PDF in memory, and install the callback for fetching the data. procedure PDF_open_mem( p : access PDF; write : write_proc); -- Closes generated PDF file, and free every document-related resources. procedure PDF_close( p: access PDF); -- Appends new page to the document. procedure PDF_begin_page( p : access PDF; width : P_Float; height: P_Float); -- Finishes working page. procedure PDF_end_page( p: access PDF); -- PARAMETER HANDLING -- Sets keyed PDF lib parameter with string value. procedure PDF_set_parameter( p : access PDF; key : P_String; value: P_String); -- Sets value of the keyed PDF lib parameter with a float value. procedure PDF_set_value( p : access PDF; key : P_String; value: P_Float); -- Gets contents of the keyed PDF lib parameter of string type. function PDF_get_parameter( p : access PDF; key : P_String; modifier: P_Float) return String; -- Gets value of the keyed PDF lib parameter with float type. function PDF_get_value( p : access PDF; key : P_String; modifier: P_Float) return P_Float; -- TEXT AND FONT HANDLING -- Searches for the font, prepping it for later use. The metrics will be -- loaded, and when embed > 0, the font file will be checked but -- unused. Encoding is one of "builtin", "macroman", "winansi", "host", or -- the user defined encoding name, or the name of the C(hinese)-Map. function PDF_findfont( p : access PDF; font_name : P_String; encoding : P_String; embed : P_Int) return PDF_Font; -- Sets current font of given size, utilizing the font found via PDF_findfont. procedure PDF_setfont( p : access PDF; font : PDF_Font; font_size : P_Float); -- TEXT OUTPUT -- Puts text in the current font and size at the current position. procedure PDF_show( p : access PDF; text: P_String); -- Puts text in the current font at point (x, y). procedure PDF_show_xy( p : access PDF; text: P_String; x : P_Float; y : P_Float); -- Puts text at the next line. Line spacing determined via the "leading" parameter. procedure PDF_continue_text( p : access PDF; text: P_String); -- Formats text in current font and size into the supplied text box -- The requested formatting mode has to be one of "left", -- "right", "center", "justify", or "fulljustify". When width and height = 0 -- only a single line is positioned at the point (left, top) in the -- requested mode. function PDF_show_boxed( p : access PDF; text : P_String; left : P_Float; top : P_Float; width : P_Float; height : P_Float; hmode : P_String; feature: P_String) return P_Int; -- Sets text output position. procedure PDF_set_text_pos( p: access PDF; x: P_Float; y: P_Float); -- Returns width of text of selected font. function PDF_stringwidth( p : access PDF; text: P_String; font: P_Int; size: P_Float) return P_Float; -- Function which add an extra string length parameter for use with -- strings containing null characters. e.g. for Ada with embedded nulls. -- Ditto PDF_show but with set string length. procedure PDF_show2( p : access PDF; text: String; len : P_Int); -- Ditto PDF_show_xy but with sett string length. procedure PDF_show_xy2( p : access PDF; text: String; len : P_Int; x : P_Float; y : P_Float); -- Ditto PDF_continue_text but with set string length. procedure PDF_continue_text2( p : access PDF; text: String; len : P_Int); -- Ditto PDF_stringwidth but with set string length. function PDF_stringwidth2( p : access PDF; text: String; len : P_Int; font: P_Int; size: P_Float) return P_Float; -- GRAPHICS STATE -- Sets current dash pattern to b=black and w=white units. procedure PDF_setdash( p: access PDF; b: P_Float; w: P_Float); -- Sets more complex dash pattern defined via an array. subtype Dash_Index is P_Int range 1 .. 8; type Dashes is array(Dash_Index) of P_Float; procedure PDF_setpolydash( p : access PDF; dash_array : Dashes; length : Dash_Index); -- Sets flatness to a constrained value. subtype Flatness_Type is P_Float range 0.0 ..100.0; procedure PDF_setflat( p : access PDF; flatness: Flatness_Type); -- Sets line join parameter to a constrained value. subtype Line_Type is P_Int range 0 .. 2; procedure PDF_setlinejoin( p : access PDF; line_join : Line_Type); -- Sets line cap parameter to a constrained value. procedure PDF_setlinecap( p : access PDF; line_cap : Line_Type); -- Sets miter limit to constrained value >= 1. subtype Miter_Type is P_Float range 1.0 ..P_Float'Last; procedure PDF_setmiterlimit( p : access PDF; miter: Miter_Type); -- Sets current linewidth to width. procedure PDF_setlinewidth( p : access PDF; width: P_Float); -- Resets every color and graphics state parameters to default. procedure PDF_initgraphics( p: access PDF); -- Saves current graphics state. procedure PDF_save( p: access PDF); -- Restores most recently saved graphics state. procedure PDF_restore( p: access PDF); -- Translates origin of the coordinate system. procedure PDF_translate( p : access PDF; tx: P_Float; ty: P_Float); -- Scales coordinate system. procedure PDF_scale( p : access PDF; sx: P_Float; sy: P_Float); -- Rotates coordinate system via phi degrees. procedure PDF_rotate( p : access PDF; phi: P_Float); -- Skews coordinate system in x and y direction via alpha and beta degrees. procedure PDF_skew( p : access PDF; alpha: P_Float; beta : P_Float); -- Concatenates matrix to the current transformation matrix. procedure PDF_concat( p: access PDF; a: P_Float; b: P_Float; c: P_Float; d: P_Float; e: P_Float; f: P_Float); -- Overrides the current transformation matrix. procedure PDF_setmatrix( p: access PDF; a: P_Float; b: P_Float; c: P_Float; d: P_Float; e: P_Float; f: P_Float); -- PATH CONSTRUCTION, PAINTING, AND CLIPPING -- Sets current point. procedure PDF_moveto( p: access PDF; x: P_Float; y: P_Float); -- Draws line from the current point to (x, y). procedure PDF_lineto( p: access PDF; x: P_Float; y: P_Float); -- Draws Bezier curve from the current point, utilize 3 control points. procedure PDF_curveto( p : access PDF; x1: P_Float; y1: P_Float; x2: P_Float; y2: P_Float; x3: P_Float; y3: P_Float); -- Draws circle with center (x, y) and radius r. procedure PDF_circle( p: access PDF; x: P_Float; y: P_Float; r: P_Float); -- Draws counter-clockwise circular arc from alpha to beta degrees. procedure PDF_arc( p : access PDF; x : P_Float; y : P_Float; r : P_Float; alpha: P_Float; beta : P_Float); -- Draws clockwise circular arc from alpha to beta degrees. procedure PDF_arcn( p : access PDF; x : P_Float; y : P_Float; r : P_Float; alpha: P_Float; beta : P_Float); -- Draws rectangle at lower left (x, y) of width and height. procedure PDF_rect( p : access PDF; x : P_Float; y : P_Float; width : P_Float; height: P_Float); -- Closes current path. procedure PDF_closepath( p: access PDF); -- Draws path with the current color and line width; and then clears. procedure PDF_stroke( p: access PDF); -- Closes the path and then draws. procedure PDF_closepath_stroke( p: access PDF); -- Fills interior of the path with the current fill color. procedure PDF_fill( p: access PDF); -- Fills and draws path with current fill and stroke color. procedure PDF_fill_stroke( p: access PDF); -- Closes path, fills, and then strokes. procedure PDF_closepath_fill_stroke( p: access PDF); -- Uses current path as clipping path. procedure PDF_clip( p: access PDF); -- COLOR HANDLING -- Makes named spot color from the current color. function PDF_makespotcolor( p : access PDF; spot_name : P_String; len : P_Int) return P_Int; -- Sets current color space and color. fstype is "fill", "stroke", or "both". procedure PDF_setcolor( p : access PDF; fstype : P_String; colorspace: P_String; -- "rgb" c1 : P_Float; -- red c2 : P_Float; -- green c3 : P_Float; -- blue c4 : P_Float); -- -- PATTERN DEFINITION -- Starts a new pattern definition. function PDF_begin_pattern( p : access PDF; width : P_Float; height : P_Float; xstep : P_Float; ystep : P_Float; paint_type : P_Int) return P_Int; -- Finishes pattern definition. procedure PDF_end_pattern( p: access PDF); -- TEMPLATE DEFINITION -- Starts new template definition. function PDF_begin_template( p : access PDF; width : P_Float; height: P_Float) return Pdf_Image; -- Finishes template definition. procedure PDF_end_template( p: access PDF); -- IMAGE HANDLING -- Places image or template with the lower left corner at (x, y), and scales. procedure PDF_place_image( p : access PDF; image: Pdf_Image; x : P_Float; y : P_Float; scale: P_Float); -- Uses image data of selected data source. Supported types include -- "jpeg", "ccitt", "raw". Supported sources => "memory", "fileref", "url". -- Len is only used for type="raw"; Params is only used for type="ccitt". function PDF_open_image( p : access PDF; image_type : P_String; source : P_String; data : P_String; length : Long_Integer; width : P_Int; height : P_Int; components: P_Int; bpc : P_Int; params : P_String) return Pdf_Image; -- Opens image file. Supported types include "jpeg", "tiff", "gif", and "png" -- Stringparam is either "", "mask", "masked", or "page". Int_Param is 0 or -- the image numeral of the applied mask, or the page. function PDF_open_image_file( p : access PDF; image_type : P_String; file_name : P_String; String_param : P_String; int_param : P_Int) return Pdf_Image; -- Closes image retrieved with one of the PDF_open_image functions. procedure PDF_close_image( p : access PDF; image: Pdf_Image); -- Adds existing image as thumbnail for the current page. procedure PDF_add_thumbnail( p : access PDF; image: Pdf_Image); -- FAX-COMPRESSED DATA PROCESSING -- Opens raw CCITT image. function PDF_open_CCITT( p : access PDF; file_name : P_String; width : P_Int; height : P_Int; Bit_Reverse : P_Int; K : P_Int; Black_Is_1 : P_Int) return Pdf_Image; -- Adds nested bookmark under parent, or new top level bookmark if -- parent = 0. Returns bookmark descriptor that could be -- used as parent for subsequent nested bookmarks. If open = 1, child -- bookmarks will be folded out, but are invisible if open = 0. function PDF_add_bookmark( p : access PDF; text : P_String; parent: PDF_Bookmark; open : P_Int) return PDF_Bookmark; -- Fills document information field key with value. Key is either "Subject", -- "Title", "Creator", "Author", "Keywords", or the user-defined key. procedure PDF_set_info( p : access PDF; key : P_String; value: P_String); -- FILE ATTACHMENTS, NOTES, AND LINKS -- Adds file attachment annotation. Icon is either "graph", "paperclip", "pushpin", or "tag". procedure PDF_attach_file( p : access PDF; llx : P_Float; lly : P_Float; urx : P_Float; ury : P_Float; file_name : P_String; description : P_String; author : P_String; mime_type : P_String; icon : P_String); -- Links note annotation. Icon is either "comment", "insert", "note", -- "paragraph", "newparagraph", "key", or "help". procedure PDF_add_note( p : access PDF; llx : P_Float; lly : P_Float; urx : P_Float; ury : P_Float; contents: P_String; title : P_String; icon : P_String; open : P_Int); -- Links the file link annotation -- to the PDF target. procedure PDF_add_pdflink( p : access PDF; llx : P_Float; lly : P_Float; urx : P_Float; ury : P_Float; file_name : P_String; page : P_Int; dest : P_String); -- Link the launch annotation -- to the target of selected file type. procedure PDF_add_launchlink( p : access PDF; llx : P_Float; lly : P_Float; urx : P_Float; ury : P_Float; file_name : P_String); -- Links local annotation to the target within the current PDF file. procedure PDF_add_locallink( p : access PDF; llx : P_Float; lly : P_Float; urx : P_Float; ury : P_Float; page: P_Int; dest: P_String); -- Links a weblink annotation to the target URL on the net. procedure PDF_add_weblink( p : access PDF; llx: P_Float; lly: P_Float; urx: P_Float; ury: P_Float; url: P_String); -- Sets border style for every annotation. Style is "solid" or "dashed". procedure PDF_set_border_style( p : access PDF; style: P_String; width: P_Float); -- Sets border color for every annotation. procedure PDF_set_border_color( p : access PDF; red : P_Float; green: P_Float; blue : P_Float); -- Sets border dash style for every annotation. See PDF_setdash. procedure PDF_set_border_dash( p: access PDF; b: P_Float; w: P_Float); -- OUTPUT STREAM HANDLING -- Get contents of the PDF output buffer. The result has to be used by -- the client before calling any other PDF library function. function PDF_get_buffer( p : access PDF; size: access Long_Integer) return String; -- PAGE SIZE CONSTANTS IN POINTS (72 points/inch) Inches : constant := 72.0; a0_width : constant := 2380.0; a0_height : constant := 3368.0; a1_width : constant := 1684.0; a1_height : constant := 2380.0; a2_width : constant := 1190.0; a2_height : constant := 1684.0; a3_width : constant := 842.0; a3_height : constant := 1190.0; a4_width : constant := 595.0; a4_height : constant := 842.0; a5_width : constant := 421.0; a5_height : constant := 595.0; a6_width : constant := 297.0; a6_height : constant := 421.0; b5_width : constant := 501.0; b5_height : constant := 709.0; letter_width : constant := 612.0; -- 72 * 8.5 letter_height : constant := 792.0; -- 72 * 11.0 legal_width : constant := 612.0; legal_height : constant := 1008.0; ledger_width : constant := 1224.0; ledger_height : constant := 792.0; p11x17_width : constant := 792.0; p11x17_height : constant := 1224.0; private type PDF is record null; -- Internals : System.Address; -- Invisible end record; type PDF_Handle is new Ada.Finalization.Limited_Controlled with record Obj : PDF_Access; end record; pragma Import(C, PDF_add_bookmark, "PDF_add_bookmark"); pragma Import(C, PDF_add_launchlink, "PDF_add_launchlink"); pragma Import(C, PDF_add_locallink, "PDF_add_locallink"); pragma Import(C, PDF_add_note, "PDF_add_note"); pragma Import(C, PDF_add_pdflink, "PDF_add_pdflink"); pragma Import(C, PDF_add_thumbnail, "PDF_add_thumbnail"); pragma Import(C, PDF_add_weblink, "PDF_add_weblink"); pragma Import(C, PDF_arc, "PDF_arc"); pragma Import(C, PDF_arcn, "PDF_arcn"); pragma Import(C, PDF_attach_file, "PDF_attach_file"); pragma Import(C, PDF_begin_page, "PDF_begin_page"); pragma Import(C, PDF_begin_pattern, "PDF_begin_pattern"); pragma Import(C, PDF_begin_template, "PDF_begin_template"); pragma Import(C, PDF_boot, "PDF_boot"); pragma Import(C, PDF_circle, "PDF_circle"); pragma Import(C, PDF_clip, "PDF_clip"); pragma Import(C, PDF_close, "PDF_close"); pragma Import(C, PDF_close_image, "PDF_close_image"); pragma Import(C, PDF_closepath, "PDF_closepath"); pragma Import(C, PDF_closepath_fill_stroke, "PDF_closepath_fill_stroke"); pragma Import(C, PDF_closepath_stroke, "PDF_closepath_stroke"); pragma Import(C, PDF_concat, "PDF_concat"); pragma Import(C, PDF_continue_text, "PDF_continue_text"); pragma Import(C, PDF_continue_text2, "PDF_continue_text2"); pragma Import(C, PDF_curveto, "PDF_curveto"); pragma Import(C, PDF_delete, "PDF_delete"); pragma Import(C, PDF_end_page, "PDF_end_page"); pragma Import(C, PDF_end_pattern, "PDF_end_pattern"); pragma Import(C, PDF_end_template, "PDF_end_template"); pragma Import(C, PDF_fill, "PDF_fill"); pragma Import(C, PDF_fill_stroke, "PDF_fill_stroke"); pragma Import(C, PDF_findfont, "PDF_findfont"); -- pragma Import(C, PDF_get_buffer, "PDF_get_buffer"); pragma Import(C, PDF_get_majorversion, "PDF_get_majorversion"); pragma Import(C, PDF_get_minorversion, "PDF_get_minorversion"); pragma Import(C, PDF_get_opaque, "PDF_get_opaque"); -- pragma Import(C, PDF_get_parameter, "PDF_get_parameter"); pragma Import(C, PDF_get_value, "PDF_get_value"); pragma Import(C, PDF_initgraphics, "PDF_initgraphics"); pragma Import(C, PDF_lineto, "PDF_lineto"); pragma Import(C, PDF_makespotcolor, "PDF_makespotcolor"); pragma Import(C, PDF_moveto, "PDF_moveto"); pragma Import(C, PDF_new, "PDF_new"); pragma Import(C, PDF_new2, "PDF_new2"); pragma Import(C, PDF_open_CCITT, "PDF_open_CCITT"); pragma Import(C, PDF_open_file, "PDF_open_file"); pragma Import(C, PDF_open_fp, "PDF_open_fp"); pragma Import(C, PDF_open_image, "PDF_open_image"); pragma Import(C, PDF_open_image_file, "PDF_open_image_file"); pragma Import(C, PDF_open_mem, "PDF_open_mem"); pragma Import(C, PDF_place_image, "PDF_place_image"); pragma Import(C, PDF_rect, "PDF_rect"); pragma Import(C, PDF_restore, "PDF_restore"); pragma Import(C, PDF_rotate, "PDF_rotate"); pragma Import(C, PDF_save, "PDF_save"); pragma Import(C, PDF_scale, "PDF_scale"); pragma Import(C, PDF_set_border_color, "PDF_set_border_color"); pragma Import(C, PDF_set_border_dash, "PDF_set_border_dash"); pragma Import(C, PDF_set_border_style, "PDF_set_border_style"); pragma Import(C, PDF_set_info, "PDF_set_info"); pragma Import(C, PDF_set_parameter, "PDF_set_parameter"); pragma Import(C, PDF_set_text_pos, "PDF_set_text_pos"); pragma Import(C, PDF_set_value, "PDF_set_value"); pragma Import(C, PDF_setcolor, "PDF_setcolor"); pragma Import(C, PDF_setdash, "PDF_setdash"); pragma Import(C, PDF_setflat, "PDF_setflat"); pragma Import(C, PDF_setfont, "PDF_setfont"); pragma Import(C, PDF_setlinecap, "PDF_setlinecap"); pragma Import(C, PDF_setlinejoin, "PDF_setlinejoin"); pragma Import(C, PDF_setlinewidth, "PDF_setlinewidth"); pragma Import(C, PDF_setmatrix, "PDF_setmatrix"); pragma Import(C, PDF_setmiterlimit, "PDF_setmiterlimit"); pragma Import(C, PDF_setpolydash, "PDF_setpolydash"); pragma Import(C, PDF_show, "PDF_show"); pragma Import(C, PDF_show2, "PDF_show2"); pragma Import(C, PDF_show_boxed, "PDF_show_boxed"); pragma Import(C, PDF_show_xy, "PDF_show_xy"); pragma Import(C, PDF_show_xy2, "PDF_show_xy2"); pragma Import(C, PDF_shutdown, "PDF_shutdown"); pragma Import(C, PDF_skew, "PDF_skew"); pragma Import(C, PDF_stringwidth, "PDF_stringwidth"); pragma Import(C, PDF_stringwidth2, "PDF_stringwidth2"); pragma Import(C, PDF_stroke, "PDF_stroke"); pragma Import(C, PDF_translate, "PDF_translate"); end;