1 /////////////////////////////////////////////////////////////////////////////// 2 // Name: pdfdocdef.h 3 // Purpose: 4 // Author: Ulrich Telle 5 // Created: 2005-08-04 6 // Copyright: (c) Ulrich Telle 7 // Licence: wxWindows licence 8 /////////////////////////////////////////////////////////////////////////////// 9 10 /// \file pdfdocdef.h Compile time switches for the \b wxPdfDocument component 11 12 /** \mainpage wxPdfDocument 13 14 \section intro What is wxPdfDocument? 15 16 wxPdfDocument is a C++ class which allows wxWidgets applications to generate PDF files. 17 The code is a port of <a href="http://www.fpdf.org"><b>FPDF</b></a> - a free PHP class for 18 generating PDF files - to C++ using the <a href="http://www.wxwidgets.org"><b>wxWidgets</b></a> 19 library. wxPdfDocument does not make use of any libraries like 20 <a href="http://www.pdflib.com"><b>PDFlib</b></a> or 21 <a href="http://www.fastio.com"><b>ClibPDF</b></a> which require a fee at least for 22 commercial usage. wxPdfDocument is published under the <b>wxWidgets (formerly wxWindows) 23 license</b>. This means you may use it for any kind of usage and modify it to suit your needs. 24 25 wxPdfDocument offers all advantages of \b FPDF. Several add-on PHP scripts found on the 26 FPDF web site are incorporated into wxPdfDocument. The main features are: 27 28 - Choice of measure unit, page format and margins 29 - Page header and footer management 30 - Automatic page break 31 - Automatic line break and text justification 32 - Image support (GIF, JPEG, PNG and WMF) 33 - Colours (Grayscale, RGB, CMYK, Spot colours) 34 - Links (internal and external) 35 - 14 Adobe standard fonts 36 - TrueType and Type1 fonts (with or without embedding) and encoding support 37 - TrueType Unicode and Type0 fonts (for Chinese, Japanese and Korean) support in the Unicode build 38 - OpenType Unicode fonts support in the Unicode build 39 - Page compression 40 - Graphics primitives for the creation of simple drawings 41 - Definition of clipping areas 42 - Bookmarks for outlining the document 43 - Rotation 44 - Protecting the document by passwords and/or access permissions 45 - Text annotations 46 - PDF forms (supported field types: text, combo box, check box, radio button, push button) 47 - JavaScript 48 - Fill gradients 49 - Templates 50 - Layers (optional content groups) 51 - Simple bitmap patterns as draw and fill colours 52 53 The class can produce documents in many languages other than the Western European ones: 54 Central European, Cyrillic, Greek, Baltic and Thai, provided you own TrueType or Type1 55 fonts with the desired character set. In the Unicode build Chinese, Japanese and Korean 56 are supported, too. 57 58 A \ref overview showing all available methods in alphabetical order is provided. 59 A sample application including more than 20 examples demonstrates the different features. 60 Separate detailed descriptions are available for the \ref makefont and the \ref showfont. 61 The chapter \ref writexml describes the supported tags of the simple XML markup language 62 used by the method wxPdfDocument::WriteXml. 63 64 wxPdfDocument is hosted at <a href="https://github.com/utelle/wxpdfdoc"><b>GitHub</b></a> since end of 2015. 65 For any remark, question or problem, you can leave a message on the <a href="https://github.com/utelle/wxpdfdoc/issues">wxPdfDocument issue tracker</a> 66 Or you can send a mail to the author 67 <a href="mailto:ulrich.telle@gmx.de">directly</a>. 68 69 \section version Version history 70 71 <dl> 72 <dt><b>0.9.8</b> - <i>September 2019</i></dt> 73 <dd> 74 wxPdfDocument is compatible with wxWidgets versions 2.8.12, 3.0.x and 3.1.x. 75 76 General changes:<br> 77 - Added alpha transparency support for wxPdfDC (wxWidgets 3.x only) 78 - Eliminated error messages issued from method wxPdfFontManager::RegisterSystemFonts on registering bitmap fonts files 79 - Removed call to deprecated function wxFillLogFont 80 - Added configure options to skip building samples/utilities 81 - Added build support for Visual C++ 2019 82 - Added AppVeyor CI 83 84 Fixed bugs:<br> 85 - Fixed issue with XML tables: Rows affected by common row spans are now kept together on the same page 86 87 </dd> 88 89 <dt><b>0.9.7</b> - <i>January 2019</i></dt> 90 <dd> 91 wxPdfDocument is compatible with wxWidgets versions 2.8.12, 3.0.x and 3.1.x. 92 93 General changes:<br> 94 - Adjusted dash patterns to get (hopefully) perfect dots for all pen cap styles 95 - Added a new map mode style wxPDF_MAPMODESTYLE_PDFFONTSCALE 96 - Added support for justified text alignment when using Unicode fonts 97 - Added border width and colour attributes to XML table output 98 - Added speed up for text drawing in wxPdfDC class 99 - Added multiline text support for wxPdfDC::DoDrawRotatedText 100 - Added text background color support for wxPdfDC::DoDrawText and wxPdfDC::DoDrawRotatedText 101 102 Fixed bugs:<br> 103 - Fixed a bug when using a protected/encrypted external template 104 - Fixed an issue on failing to load an image from simple XML due to missing mimetype 105 - Fixed an issue on parsing the document information of an existing PDF document 106 - Fixed a wxPdfParser issue with "startxref" not found 107 - Fixed a crash on importing a completely empty page 108 - Fixed a problem with empty content streams on import 109 - Fixed several glitches in XML support 110 - Fixed issue using wrong pen on drawing splines in method wxPdfDC::DoDrawSpline 111 - Fixed issues in wxPdfDC class by taking transparency of pen and brush into account. 112 113 </dd> 114 115 <dt><b>0.9.6</b> - <i>April 2017</i></dt> 116 <dd> 117 wxPdfDocument is compatible with wxWidgets version 2.8.12 and version 3.1.0. 118 119 General changes:<br> 120 - Overhauled the build system 121 - Added continuous integration (Travis CI) 122 - Replaced all occurrences of macro \b wxT by \b wxS 123 - Added version information as Windows resource for DLL builds on Windows 124 125 Fixed bugs:<br> 126 - Fixed adjustment of angles in method wxPdfDocument::Ellipse 127 - Fixed issue with drawing arcs from wxPdfDC by forcing angles into proper range for counter-clockwise drawing 128 - Replaced MD5 implementation to resolve a license incompatibility issue 129 - Replaced image in transparency sample to resolve a potential license issue 130 131 </dd> 132 133 <dt><b>0.9.5</b> - <i>December 2015</i></dt> 134 <dd> 135 wxPdfDocument is compatible with wxWidgets version 2.8.12 and version 3.0.2. 136 137 General changes:<br> 138 - respect "join" and "cap" attributes of wxPen in wxPdfDC (2.9) 139 - cleaned up the use of wxMemoryOutputStream instances 140 - cleaned up dependencies on wxWidgets libraries for graphics formats GIF and JPEG 141 142 Fixed bugs:<br> 143 - fixed a bug in positioning rotated text 144 - fixed a bug in determining line lengths in XML formatted output 145 - fixed a bug in drawing a point in wxPdfDC (2.9) 146 - fixed a bug in drawing elliptic arcs in wxPdfDC (2.9) 147 148 </dd> 149 150 <dt><b>0.9.4</b> - <i>August 2013</i></dt> 151 <dd> 152 wxPdfDocument is compatible with wxWidgets version 2.8.12 and version 2.9.5. 153 Compatibility with older wxWidgets versions is not guaranteed, but it should 154 work with all 2.8.x versions. 155 156 General changes:<br> 157 - added handling of Unicode surrogates for TrueType Unicode fonts (in wxPdfDocument library and in ShowFont utility) 158 - added missing initialization for image format type to use in wxPdfDC 159 - added support to write wxImage objects in JPEG format to PDF (instead of PNG format only) 160 161 Fixed bugs:<br> 162 - corrected the handling of sectors in method wxPdfDocument::Ellipse 163 - fixed a bug in ShowFont (font index for TrueType collections was not selectable) 164 - fixed a bug in the Type1 font parser (parsing /Subrs could hang) 165 - fixed a bug in the Type1 font parser (endless loop when parsing Type1 multi master font files) 166 - fixed a bug in TrueType font parser reading wrong values from OS/2 table version 0 167 - adjusted default font metrics in wxPdfDC and external leading to always >= 0 168 - fixed a GDI object leak in TrueType font parser (Windows only) 169 170 </dd> 171 172 <dt><b>0.9.3</b> - <i>June 2012</i></dt> 173 <dd> 174 wxPdfDocument is compatible with wxWidgets version 2.8.12 and version 2.9.3. 175 Compatibility with older wxWidgets versions is not guaranteed, but it should 176 work with all 2.8.x versions. 177 178 General changes:<br> 179 - added methods to access the bottom right coordinates of the last inserted image 180 - added span tag to XML markup 181 - added method wxPdfDocument::AttachFile to attach files to PDF documents 182 - added compile time option to derive wxPdfDocument from wxObject (makes interfacing to wxPerl easier) 183 - integrated enhancements to wxPdfDC and MakeFont contributed by Mark Dootson 184 - added support for the wxWidgets printing framework (contributed by Mark Dootson) 185 - enhanced wxPdfDC sample application to demonstrate the integration with the printing framework (contributed by Mark Dootson) 186 187 Fixed bugs:<br> 188 - fixed a bug in pdffontdatacore.cpp (non-ASCII characters didn't show on OSX) 189 - fixed a bug in pdfencrypt.cpp (setting a non-empty document id) 190 - fixed a bug in pdfxml.cpp (force line break for words too long to fit on a line) 191 - fixed in bug in handling external templates in conjunction with protection (crypting used the wrong object id for strings and streams) 192 193 </dd> 194 195 <dt><b>0.9.2</b> - <i>September 2011</i></dt> 196 <dd> 197 wxPdfDocument is compatible with wxWidgets version 2.8.12 and version 2.9.2. 198 Compatibility with older wxWidgets versions is not guaranteed, but it should 199 work with all 2.8.x versions. 200 201 General changes:<br> 202 - added method wxPdfDC::GetPdfDocument for builds based on wxWidgets 2.9.x 203 - added method wxPdfDocument::WriteXml for direct handling of wxXmlNode instances 204 - added support for optionally activating/deactivating message translation (<b>msg</b> tag) in XML output method 205 - added optional document id parameter for method wxPdfEncrypt::GenerateEncryptionKey 206 207 Fixed bugs:<br> 208 - fixed a bug in method wxPdfDocument::CalculatePageSize 209 - fixed a bug in wxPdfFontDataCore::ConvertCID2GID 210 - fixed several scaling bugs in wxPdfDC 211 - fixed several warnings in pdfkernel regarding formatted output of size_t variables 212 - fixed minor issues with Bengali font 213 214 </dd> 215 216 <dt><b>0.9.1</b> - <i>January 2011</i></dt> 217 <dd> 218 wxPdfDocument is compatible with wxWidgets version 2.8.11 and version 2.9.1. 219 Compatibility with older wxWidgets versions is not guaranteed, but it should 220 now work with all 2.8.x versions. 221 222 Added features:<br> 223 - added support for Apple Unicode TrueType fonts 224 - added the \ref showfont 225 226 General changes:<br> 227 - optimized the processing speed of VOLT rules 228 - modified the code for wxMac support 229 - modified the sample tutorial7 to test the new wxMac font loading code 230 - added check for valid 'cmap' table in wxPdfFontParserTrueType 231 - added call to method wc_str for wxString parameters in calls to FromWChar 232 - implemented method RegisterSystemFonts for wxMac 233 - samples changed to set the executable path as the current working directory 234 235 Fixed bugs:<br> 236 - fixed a memory leak on registering a font identified by a wxFont object 237 - fixed a bug in method ShowGlyph 238 - fixed several wxMac compile time bugs (missing includes, some typos) 239 - changed the wxMac print dialog includes in the printing sample 240 241 </dd> 242 243 <dt><b>0.9.0</b> - <i>December 2010</i></dt> 244 <dd> 245 wxPdfDocument is compatible with wxWidgets version 2.8.11 and version 2.9.1. 246 Compatibility with older wxWidgets versions is not guaranteed. 247 248 This is the first release of wxPdfDocument containing a <b>PDF drawing context</b> (wxPdfDC). 249 There are implementations for wxWidgets 2.8.x and 2.9.x; the matching implementation 250 is selected automatically at compile time. Please report your experiences with wxPdfDC 251 to the author of wxPdfDocument, be it bug reports, contributions or feature requests. 252 253 \b Note: A <b>PDF graphics context</b> is planned for one of the next releases of wxPdfDocument. 254 Most likely only wxWidgets 2.9.x will be supported since the internals of the base class 255 wxGraphicsContext differ considerably between wxWidgets 2.8.x and 2.9.x. 256 257 Added features:<br> 258 - methods to draw Bezier splines through a list of points; 259 the drawing sample has been extended to show the new functionality 260 - PDF drawing context (wxPdfDC); not yet all methods are implemented 261 - support for fonts with VOLT (Visual Ordering and Layout Tables) data 262 (currently visual ordering only, preprocessing of the fonts required); 263 fonts for 9 Indic scripts are included to demonstrate this feature 264 265 General changes:<br> 266 - increased output speed for method SaveAsFile (if large graphics files are involved) 267 - all currently supported CJK font families are now registered automatically at startup of the font manager 268 - MS CJK fonts aren't automatically registered as Type0 fonts, 269 since this conflicts with registering these fonts as TrueType Unicode fonts 270 - handling of image masks has been improved 271 272 Fixed bugs:<br> 273 - opening font files could fail if the file path contained non-latin characters 274 Now wxFileSystem::FileNameToURL is used to create valid file names for use in method OpenFile of wxFileSystem 275 - invalid format codes in method wxPdfUtility::Double2String could cause problems in MinGW environment 276 - registering half-width CJK fonts didn't work 277 - bug in page size handling 278 - no file was written when Close was called before SaveAsFile 279 - bug in the handling of transparency for image masks 280 - uninitialized member variables in layer objects possibly causing invisibility of layers 281 - cleaned up output formatting codes for building on 64-bit systems 282 - compile time bugs for wxWidgets built with wxUSE_STL 283 - several minor bugs 284 285 </dd> 286 287 <dt><b>0.8.5</b> - <i>October 2009</i></dt> 288 <dd> 289 wxPdfDocument is compatible with wxWidgets version 2.8.10. Some preparations were done 290 to make wxPdfDocument compatible with version 2.9.x and above, too. 291 292 Added features in <b>all</b> builds:<br> 293 - support for individual page sizes 294 - support for setting fill rule to <i>odd/even</i> or <i>winding</i> 295 - support for setting the text render mode 296 - support for layers (optional content groups) 297 - support for patterns as draw and fill colours 298 - support for Code 128 barcodes 299 300 Added features in <b>Unicode</b> build:<br> 301 - support for kerning 302 - support for different encodings for Type1 and TrueType fonts 303 - support for using TrueType and OpenType fonts loaded directly from .ttf or .otf file 304 - support for using Type1 fonts loaded directly from .pfb and .afm file 305 - support for using TrueType and OpenType fonts defined by a wxFont object 306 - font subsetting for OpenType Unicode fonts (experimental, currently non-CID fonts only) 307 - direct positioning and writing of glyph numbers for TrueType/OpenType Unicode fonts<br> 308 this may be used in conjunction with tools for writing complex scripts like ICU 309 310 Added features in <b>ANSI</b> build:<br> 311 - support for fonts defined by a wxFont object (mapped by family, weight and style to the Adobe core fonts) 312 313 General changes:<br> 314 - coordinate transformation (location of origin and y axis orientation) 315 is now done directly in PDF. This was a prerequisite to add wxGraphicsContext support 316 in an upcoming version. User unit scaling is done programmatically. 317 - unified the naming of all methods manipulating colours. Now always the 318 British spelling is used, i.e. <i>colour</i> instead of <i>color</i>. 319 320 Fixed bugs:<br> 321 - line style measurements did not use user units 322 - encryption support for big endian platforms. 323 - method wxPdfDocument::ClippingText. 324 </dd> 325 326 <dt><b>0.8.0</b> - <i>December 2006</i></dt> 327 <dd> 328 Added features:<br> 329 - support for external templates: pages of existing PDF documents may be imported and used as templates 330 - font subsetting for TrueType and TrueType Unicode fonts, often resulting in much smaller PDF file sizes 331 - support for using and embedding OpenType Unicode fonts 332 - enhanced support for password based encryption, encryption key length freely definable between 40 and 128 bits (<b>Attention</b>: Adobe Reader supports only keys with 40 or 128 bits.) 333 - support for AES encryption (additional standard encryption method in PDF version 1.6 and above) 334 335 wxPdfDocument is compatible with wxWidgets version 2.8.0 as well as with version 2.6.x. 336 337 As an add-on preprocessed font files for the free <a href="http://dejavu.sourceforge.net">DejaVu fonts</a> 338 (version 2.12) are provided in the file release <b><a href="http://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182&release_id=468705">wxPdfDocument Add-Ons</a></b>. 339 340 <b>Attention</b>: For supporting font subsetting for ordinary non-Unicode TrueType fonts 341 the format of the font definition files has been extended. Font definition files created 342 with prior versions of the \ref makefont are still usable, but do not support font subsetting. 343 It is recommended to regenerate own font definition files. Unfortunately common AFM font metric 344 files do not contain glyph information which is required by the \ref makefont to create the 345 character-to-glyph mapping. Therefore the utility <tt>ttf2ufm</tt> had to be changed. 346 The modified version including a Windows executable is available in the file release <b><a href="http://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182&release_id=468705">wxPdfDocument Add-Ons</a></b>. 347 </dd> 348 349 <dt><b>0.7.6</b> - <i>October 2006</i></dt> 350 <dd> 351 Added features (thanks to Stuart Smith):<br> 352 - setting/getting the default path used for loading font files 353 - getting the description of the current font 354 - loading images from a wxInputStream (in addition to loading from file or wxImage) 355 356 <b>Attention</b>: The structure of the font definition files has changed due to 357 the addition of the font attribute <tt>xHeight</tt>. It is necessary to regenerate own 358 font definition files using the \ref makefont. To support the <tt>xHeight</tt> attribute the utility 359 <tt>ttf2ufm</tt> had to be changed. 360 361 wxPdfDocument is now compatible with wxWidgets version 2.7.1 and above as well as with version 2.6.x. 362 363 Fixed several bugs 364 </dd> 365 366 <dt><b>0.7.5</b> - <i>September 2006</i></dt> 367 <dd> 368 Added or enhanced features:<br> 369 - support for tables in simple XML markup spanning more than a page 370 - support for internal links in simple XML markup 371 - support for transparency 372 - support for image masks 373 - support for internal templates 374 - support for polygon and shape clipping 375 - support for printing text along a path 376 - extended support for fill gradients (<b>API changed!</b>) 377 - internal colour management reworked 378 379 Fixed some minor bugs 380 </dd> 381 382 <dt><b>0.7</b> - <i>April 2006</i></dt> 383 <dd> 384 Added features:<br> 385 - support for CMYK and spot colours 386 - support for named colours (486 predefined names for RGB colours) (wxPdfColour) 387 - support for colour names in HTML notation (\#rrggbb) (wxPdfColour) 388 - text annotations 389 - additional font decorations: overline, strikeout 390 - PDF forms 391 - JavaScript at the document level 392 - Simple XML markup language for styling and structuring text 393 394 Added or modified methods:<br> 395 - wxPdfDocument::LineCount, wxPdfDocument::TextBox and several getter methods were added for convenience 396 - wxPdfDocument::MultiCell now respects a maximal line count 397 - wxPdfDocument::WriteXml allows to print text containing simple XML markup 398 </dd> 399 400 <dt><b>0.6</b> - <i>November 2005</i></dt> 401 <dd> 402 Added features: 403 - gradients 404 - transformations 405 - barcodes<br> 406 - \ref makefont <br> 407 408 Changed API of graphics primitives: line style and fill colour parameters deleted, 409 line style and fill colour have to be set using wxPdfDocument::SetLineStyle and wxPdfDocument::SetFillColour. 410 </dd> 411 412 <dt><b>0.5</b> - <i>September 2005</i></dt> 413 <dd> 414 First public release 415 </dd> 416 417 <dt><b>0.4</b> - <i>August 2005</i></dt> 418 <dd> 419 Support for embedding fonts 420 </dd> 421 422 <dt><b>0.3</b> - <i>July 2005</i></dt> 423 <dd> 424 Support for embedding images 425 </dd> 426 427 <dt><b>0.2</b> - <i>June 2005</i></dt> 428 <dd> 429 Several add-ons implemented 430 </dd> 431 432 <dt><b>0.1</b> - <i>May 2005</i></dt> 433 <dd> 434 Planning and basic PDF features implemented 435 </dd> 436 </dl> 437 438 \author Ulrich Telle (<a href="mailto:ulrich.telle@gmx.de">ulrich DOT telle AT gmx DOT de</a>) 439 440 \section issues Known issues 441 442 Currently there are no known issues regarding the functionality of the wxPdfDocument component. 443 All features were thoroughly tested individually, but it's almost impossible to check all 444 potential combinations. <b>If you find bugs please report them to the author!</b> 445 446 \section acknowledgement Acknowledgements 447 448 I'm very grateful to <b>Bruno Lowagie</b>, the main author of the <b>iText Java library</b> 449 (http://www.lowagie.com/iText), for allowing to take lots of ideas and inspirations 450 from this great Java PDF library. Especially the font handling and font subsetting 451 was influenced in that way. 452 453 Many thanks go to <b>Ben Moores</b> who provided code for layers and patterns he wrote for 454 his PDF extension for <b>Mapnik</b> (http://www.mapnik.org). This code has been extended 455 based on ideas from the <b>iText Java library</b> and was incorporated into wxPdfDocument. 456 457 Support for Indic scripts is based on the efforts of <b>Ian Back</b>, creator of the PHP library \b mPDF 458 (http://mpdf.bpm1.com); special thanks to <b>K Vinod Kumar</b> of the Centre for Development of Advanced 459 Computing, Mumbai (http://www.cdacmumbai.in), for clearing license issues of the Raghu font series. 460 461 Kudos to <b>Mark Dootson</b> for contributing major enhancements of wxPdfDC and it's integration 462 into the wxWidgets printing framework. 463 464 Since wxPdfDocument is based on the great \b FPDF PHP class and several of the contributions to it 465 found on the <a href="http://www.fpdf.org"><b>FPDF website</b></a> I would like to thank 466 467 - Olivier Plathey (FPDF, Barcodes, Bookmarks, Rotation), 468 - Maxime Delorme (Sector) 469 - Johannes Guentert (JavaScript) 470 - Martin Hall-May (WMF images, Transparency) 471 - Emmanuel Havet (Code39 barcodes) 472 - Shailesh Humbad (POSTNET barcodes) 473 - Matthias Lau (i25 barcodes) 474 - Pierre Marletta (Diagrams) 475 - Laurent Passebecq (Labels) 476 - David Hernandez Sanz (additional graphics primitives) 477 - Valentin Schmidt (Transparency, Alpha channel) 478 - Jan Slabon (FPDI) 479 - Klemen Vodopivec (Protection) 480 - Moritz Wagner (Transformation) 481 - Andreas Wuermser (Clipping, Gradients, Transformation) 482 483 The wxPdfDocument encryption methods use the MD5 Message Digest 484 Algorithm implementation of Alexander Peslyak (Public Domain) and 485 the Rijndael cipher implementation of Szymon Stefanek (Public Domain). 486 For detailed license information \see files pdfencrypt.cpp and pdfrijndael.h. 487 488 */ 489 490 /** \page overview Reference Manual 491 The documentation of wxPdfDocument is created by Doxygen. To make it easier to locate the description 492 of a specific method the following alphabetical list shows all available methods: 493 494 \section refpdfdoc wxPdfDocument 495 496 \li wxPdfDocument::AcceptPageBreak - accept or not automatic page break 497 \li wxPdfDocument::AddFont - add a new font 498 \li wxPdfDocument::AddFontCJK - add a CJK (Chinese, Japanese or Korean) font 499 \li wxPdfDocument::AddLayer - add a layer (optional content group) 500 \li wxPdfDocument::AddLayerTitle - add a layer title 501 \li wxPdfDocument::AddLayerMembership - add a layer group 502 \li wxPdfDocument::AddLayerRadioGroup - add a layer radio group 503 \li wxPdfDocument::AddLink - create an internal link 504 \li wxPdfDocument::AddPage - add a new page 505 \li wxPdfDocument::AddPattern - add a simple pattern 506 \li wxPdfDocument::AddSpotColour - add a spot colour 507 \li wxPdfDocument::AliasNbPages - define an alias for number of pages 508 \li wxPdfDocument::Annotate - add a text annotation 509 \li wxPdfDocument::AppendJavascript - add document level JavaScript 510 \li wxPdfDocument::Arrow - draw an arrow 511 \li wxPdfDocument::AttachFile - add a file attachment 512 \li wxPdfDocument::AxialGradient - define axial gradient shading 513 514 \li wxPdfDocument::BeginTemplate - start template creation 515 \li wxPdfDocument::Bookmark - add a bookmark 516 517 \li wxPdfDocument::Cell - print a cell 518 \li wxPdfDocument::CheckBox - add a check box to a form 519 \li wxPdfDocument::Circle - draw a circle 520 \li wxPdfDocument::ClippingText - define text as clipping area 521 \li wxPdfDocument::ClippingRect - define rectangle as clipping area 522 \li wxPdfDocument::ClippingEllipse - define ellipse as clipping area 523 \li wxPdfDocument::ClippingPath - start defining a clipping path 524 \li wxPdfDocument::ClippingPolygon - define polygon as clipping area 525 \li wxPdfDocument::ClippedCell - print a clipped cell 526 \li wxPdfDocument::Close - terminate the document 527 \li wxPdfDocument::CloseAndGetBuffer - terminate the document and return the document buffer 528 \li wxPdfDocument::ClosePath - close a clipping path 529 \li wxPdfDocument::ComboBox - add a combo box to a form 530 \li wxPdfDocument::CoonsPatchGradient - define coons patch mesh gradient shading 531 \li wxPdfDocument::Curve - draw a Bezier curve 532 \li wxPdfDocument::CurveTo - append a cubic Bezier curve to a clipping path 533 534 \li wxPdfDocument::Ellipse - draw an ellipse 535 \li wxPdfDocument::EndTemplate - end template creation 536 \li wxPdfDocument::EnterLayer - enter a layer 537 538 \li wxPdfDocument::Footer - page footer. 539 540 \li wxPdfDocument::GetBreakMargin - get the page break margin 541 \li wxPdfDocument::GetCellMargin - get the cell margin 542 \li wxPdfDocument::GetDrawColour - get current draw colour 543 \li wxPdfDocument::GetFillColour - get current fill colour 544 \li wxPdfDocument::GetFillingRule - get current filling rule 545 \li wxPdfDocument::GetFontDescription - get description of current font 546 \li wxPdfDocument::GetFontFamily - get current font family 547 \li wxPdfDocument::GetFontSize - get current font size in points 548 \li wxPdfDocument::GetFontStyle - get current font style 549 \li wxPdfDocument::GetFontStyles - get current font styles 550 \li wxPdfDocument::GetFontSubsetting - get font embedding mode 551 \li wxPdfDocument::GetImageScale - get image scale 552 \li wxPdfDocument::GetLastImageBottomRightX - get the X coordinate of the bottom right corner of the last inserted image 553 \li wxPdfDocument::GetLastImageBottomRightY - get the Y coordinate of the bottom right corner of the last inserted image 554 \li wxPdfDocument::GetLeftMargin - get the left margin 555 \li wxPdfDocument::GetLineHeight - get line height 556 \li wxPdfDocument::GetLineStyle - get current line style 557 \li wxPdfDocument::GetLineWidth - get current line width 558 \li wxPdfDocument::GetPageHeight - get page height 559 \li wxPdfDocument::GetPageWidth - get page width 560 \li wxPdfDocument::GetPatternColour - get pattern as colour 561 \li wxPdfDocument::GetRightMargin - get the right margin 562 \li wxPdfDocument::GetScaleFactor - get scale factor 563 \li wxPdfDocument::GetSourceInfo - get info dictionary of external document 564 \li wxPdfDocument::GetStringWidth - compute string length 565 \li wxPdfDocument::GetTemplateBBox - get bounding box of template 566 \li wxPdfDocument::GetTemplateSize - get size of template 567 \li wxPdfDocument::GetTextColour - get current text colour 568 \li wxPdfDocument::GetTextRenderMode - get current text render mode 569 \li wxPdfDocument::GetTopMargin - get the top margin 570 \li wxPdfDocument::GetX - get current x position 571 \li wxPdfDocument::GetY - get current y position 572 573 \li wxPdfDocument::Header - page header 574 575 \li wxPdfDocument::Image - output an image 576 \li wxPdfDocument::ImageMask - define an image mask 577 \li wxPdfDocument::ImportPage - import page of external document for use as template 578 \li wxPdfDocument::IsInFooter - check whether footer output is in progress 579 580 \li wxPdfDocument::LeaveLayer - leave layer 581 \li wxPdfDocument::Line - draw a line 582 \li wxPdfDocument::LinearGradient - define linear gradient shading 583 \li wxPdfDocument::LineCount - count the number of lines a text would occupy 584 \li wxPdfDocument::LineTo - append straight line segment to a clipping path 585 \li wxPdfDocument::Link - put a link 586 \li wxPdfDocument::Ln - line break 587 \li wxPdfDocument::LockLayer - lock a layer 588 589 \li wxPdfDocument::Marker - draw a marker symbol 590 \li wxPdfDocument::MidAxialGradient - define mid axial gradient shading 591 \li wxPdfDocument::MirrorH - mirror horizontally 592 \li wxPdfDocument::MirrorV - mirror vertically 593 \li wxPdfDocument::MoveTo - begin new subpath of a clipping path 594 \li wxPdfDocument::MultiCell - print text with line breaks 595 596 \li wxPdfDocument::Open - start output to the PDF document 597 598 \li wxPdfDocument::PageNo - page number 599 \li wxPdfDocument::Polygon - draw a polygon 600 \li wxPdfDocument::PushButton - add a push button to a form 601 602 \li wxPdfDocument::RadialGradient - define radial gradient shading 603 \li wxPdfDocument::RadioButton - add a radio button to a form 604 \li wxPdfDocument::Rect - draw a rectangle 605 \li wxPdfDocument::RegularPolygon - draw a regular polygon 606 \li wxPdfDocument::Rotate - rotate around a given center 607 \li wxPdfDocument::RotatedImage - rotate image 608 \li wxPdfDocument::RotatedText - rotate text string 609 \li wxPdfDocument::RoundedRect - draw a rounded rectangle 610 611 \li wxPdfDocument::SaveAsFile - save the document to a file 612 \li wxPdfDocument::Scale - scale in X and Y direction 613 \li wxPdfDocument::ScaleX - scale in X direction only 614 \li wxPdfDocument::ScaleXY - scale equally in X and Y direction 615 \li wxPdfDocument::ScaleY - scale in Y direction only 616 \li wxPdfDocument::Sector - draw a sector 617 \li wxPdfDocument::SetAlpha - set alpha transparency 618 \li wxPdfDocument::SetAlphaState - set alpha state 619 \li wxPdfDocument::SetAuthor - set the document author 620 \li wxPdfDocument::SetAutoPageBreak - set the automatic page breaking mode 621 \li wxPdfDocument::SetCellMargin - set cell margin 622 \li wxPdfDocument::SetCompression - turn compression on or off 623 \li wxPdfDocument::SetCreator - set document creator 624 \li wxPdfDocument::SetDisplayMode - set display mode 625 \li wxPdfDocument::SetDrawColour - set drawing colour 626 \li wxPdfDocument::SetDrawPattern - set draw colour pattern 627 \li wxPdfDocument::SetFillColour - set filling colour 628 \li wxPdfDocument::SetFillGradient - paint a rectangular area using a fill gradient 629 \li wxPdfDocument::SetFillingRule - set filling rule 630 \li wxPdfDocument::SetFillPattern - set fill colour pattern 631 \li wxPdfDocument::SetFont - set font 632 \li wxPdfDocument::SetFontSize - set font size 633 \li wxPdfDocument::SetFontSubsetting - set font embedding mode 634 \li wxPdfDocument::SetFormBorderStyle - set form field border style 635 \li wxPdfDocument::SetFormColours - set form field colours (border, background, text) 636 \li wxPdfDocument::SetImageScale - set image scale 637 \li wxPdfDocument::SetKerning - set kerning mode 638 \li wxPdfDocument::SetKeywords - associate keywords with document 639 \li wxPdfDocument::SetLeftMargin - set left margin 640 \li wxPdfDocument::SetLineHeight - set line height 641 \li wxPdfDocument::SetLineStyle - set line style 642 \li wxPdfDocument::SetLineWidth - set line width 643 \li wxPdfDocument::SetLink - set internal link destination 644 \li wxPdfDocument::SetMargins - set margins 645 \li wxPdfDocument::SetProtection - set permissions and/or passwords 646 \li wxPdfDocument::SetRightMargin - set right margin 647 \li wxPdfDocument::SetSourceFile - set source file of external template document 648 \li wxPdfDocument::SetSubject - set document subject 649 \li wxPdfDocument::SetTemplateBBox - set bounding box of template 650 \li wxPdfDocument::SetTextColour - set text colour 651 \li wxPdfDocument::SetTextPattern - set text colour pattern 652 \li wxPdfDocument::SetTextRenderMode - set text render mode 653 \li wxPdfDocument::SetTitle - set document title 654 \li wxPdfDocument::SetTopMargin - set top margin 655 \li wxPdfDocument::SetViewerPreferences - set viewer preferences 656 \li wxPdfDocument::SetX - set current x position 657 \li wxPdfDocument::SetXY - set current x and y positions 658 \li wxPdfDocument::SetY - set current y position 659 \li wxPdfDocument::Shape - draw shape 660 \li wxPdfDocument::ShapedText - print text along a path 661 \li wxPdfDocument::Skew - skew in X and Y direction 662 \li wxPdfDocument::SkewX - skew in Y direction only 663 \li wxPdfDocument::SkewY - skew in Y direction only 664 \li wxPdfDocument::StarPolygon - draw star polygon 665 \li wxPdfDocument::StartTransform - begin transformation 666 \li wxPdfDocument::StopTransform - end transformation 667 668 \li wxPdfDocument::Text - print a string 669 \li wxPdfDocument::TextBox - print a string horizontally and vertically aligned in a box 670 \li wxPdfDocument::TextField - add a text field to a form 671 \li wxPdfDocument::Transform - set transformation matrix 672 \li wxPdfDocument::Translate - move the origin 673 \li wxPdfDocument::TranslateX - move the X origin only 674 \li wxPdfDocument::TranslateY - move the Y origin only 675 676 \li wxPdfDocument::UnsetClipping - remove clipping area 677 \li wxPdfDocument::UseTemplate - use template 678 679 \li wxPdfDocument::Write - print flowing text 680 \li wxPdfDocument::WriteCell - print flowing text with cell attributes 681 \li wxPdfDocument::WriteGlyphArray - print array of glyphs 682 \li wxPdfDocument::WriteXml - print flowing text containing simple XML markup 683 684 \li wxPdfDocument::wxPdfDocument - constructor 685 \li wxPdfDocument::~wxPdfDocument - destructor 686 687 \section refpdffontmanager wxPdfFontManager 688 689 \li wxPdfFontManager::AddSearchPath - add path entries to the font search path list 690 691 \li wxPdfFontManager::GetDefaultEmbed - get the default embedding mode 692 \li wxPdfFontManager::GetDefaultSubset - get the default subsetting mode 693 \li wxPdfFontManager::GetFont - get a font by name and style or index 694 \li wxPdfFontManager::GetFontCount - get the number of registered fonts 695 \li wxPdfFontManager::GetFontManager - get the font manager 696 697 \li wxPdfFontManager::InitializeFontData - initialize the font data of a font 698 699 \li wxPdfFontManager::RegisterFont - register a font 700 \li wxPdfFontManager::RegisterFontCJK - register a CJK font family 701 \li wxPdfFontManager::RegisterFontCollection - register a font collection 702 \li wxPdfFontManager::RegisterFontDirectory - register all fonts located in a directory 703 \li wxPdfFontManager::RegisterSystemFonts - register the fonts known to the operating system 704 705 \li wxPdfFontManager::SetDefaultEmbed - set the default embedding mode 706 \li wxPdfFontManager::SetDefaultSubset - set the default subsetting mode 707 708 \section refpdfbarcode wxPdfBarCodeCreator 709 710 \li wxPdfBarCodeCreator::Code128 711 \li wxPdfBarCodeCreator::Code128A 712 \li wxPdfBarCodeCreator::Code128B 713 \li wxPdfBarCodeCreator::Code128C 714 \li wxPdfBarCodeCreator::Code39 715 \li wxPdfBarCodeCreator::EAN128 716 \li wxPdfBarCodeCreator::EAN13 717 \li wxPdfBarCodeCreator::UPC_A 718 \li wxPdfBarCodeCreator::I25 719 \li wxPdfBarCodeCreator::PostNet 720 721 */ 722 723 /** \page makefont MakeFont Utility 724 \section mkfontadd Adding new fonts and encoding support 725 726 This section explains how to use \b TrueType or \b Type1 fonts so that you are not 727 limited to the standard fonts any more. The other interest is that you can 728 choose the font encoding, which allows you to use other languages than the 729 Western ones (the standard fonts having too few available characters). 730 731 There are two ways to use a new font: embedding it in the PDF or not. When a 732 font is not embedded, it is sought in the system. The advantage is that the 733 PDF file is lighter; on the other hand, if it is not available, a substitution 734 font is used. So it is preferable to ensure that the needed font is installed 735 on the client systems. If the file is to be viewed by a large audience, it is 736 better to embed the fonts. 737 738 Adding a new font requires three steps for \b TrueType fonts: 739 740 \li Generation of the metric file (.afm) 741 \li Generation of the font definition file (.xml) 742 \li Declaration of the font in the program 743 744 For \b Type1, the first one is theoretically not necessary because the AFM file is 745 usually shipped with the font. In case you have only a metric file in PFM format, 746 it must be converted to AFM first. 747 748 \section mkfontgen1 Generation of the metric file 749 750 The first step for a \b TrueType font consists in generating the AFM file (or UFM file in case of a 751 <b>Unicode TrueType</b> font). A utility exists to do this task: <tt>ttf2ufm</tt> - a special version of 752 <tt>ttf2pt1</tt> - allowing to create AFM and/or UFM files. <tt>ttf2ufm</tt> has been modified to 753 generate AFM and UFM files containing all the information which is required by the utility program 754 \b makefont. An archive containing the modified source code of <tt>ttf2ufm</tt> and a Windows executable can be 755 downloaded from <b><a href="http://wxcode.sourceforge.net/docs/wxpdfdoc/ttf2ufm.zip">here</a></b>. 756 The command line to use is the following: 757 758 <tt>ttf2ufm -a font.ttf font </tt> 759 760 For example, for Comic Sans MS Regular: 761 762 <tt>ttf2ufm -a c:/windows/fonts/comic.ttf comic </tt> 763 764 Two files are created; the one we are interested in is comic.afm. 765 766 \remark Starting with wxPdfDocument version 0.8.5 this step may be ommitted for 767 TrueType and OpenType fonts. 768 769 \section mkfontgen2 Generation of the font definition file 770 771 The second step consists in generating a wxPdfDocument font metrics XML file containing 772 all the information needed by wxPdfDocument; in addition, the font file is compressed. 773 To do this, a utility program, \b makefont, is provided. 774 775 <tt>makefont {-a font.afm | -u font.ufm | -i } [-f font.{ttf|pfb}] [-e encoding] [-p patch] [-t {ttf|otf|t1}] [-o outdir]</tt> 776 777 <table border=0> 778 <tr><td><tt>-a font.afm</tt></td><td>AFM font metric file for \b TrueType or \b Type1 fonts</td></tr> 779 <tr><td><tt>-u font.ufm</tt></td><td>UFM font metric file for <b>TrueType Unicode</b> or <b>OpenType Unicode</b> fonts</td></tr> 780 <tr><td><tt>-i</tt></td><td>Extract font metrics directly from <b>TrueType Unicode</b> or <b>OpenType Unicode</b> fonts</td></tr> 781 <tr><td valign="top"><tt>-f font.{ttf|otf|pfb}</tt></td><td>font file (<tt>.ttf</tt> = TrueType, <tt>.otf</tt> = OpenType, <tt>.pfb</tt> = Type1). 782 <br>If you own a Type1 font in ASCII format (<tt>.pfa</tt>), you can convert it to binary format with 783 <a href="http://www.lcdf.org/~eddietwo/type/#t1utils">t1utils</a>. 784 <br>If you don't want to embed the font, omit this parameter. In this case, type is given by the type parameter. 785 </td></tr> 786 <tr><td valign="top"><tt>-e encoding</tt></td><td>font encoding, i.e. cp1252. Omit this parameter for a symbolic font.like <i>Symbol</i> 787 or <i>ZapfDingBats</i>. 788 789 The encoding defines the association between a code (from 0 to 255) and a character. 790 The first 128 are fixed and correspond to ASCII; the following are variable. 791 The encodings are stored in .map files. Those available are: 792 793 \li cp1250 (Central Europe) 794 \li cp1251 (Cyrillic) 795 \li cp1252 (Western Europe) 796 \li cp1253 (Greek) 797 \li cp1254 (Turkish) 798 \li cp1255 (Hebrew) 799 \li cp1257 (Baltic) 800 \li cp1258 (Vietnamese) 801 \li cp874 (Thai) 802 \li iso-8859-1 (Western Europe) 803 \li iso-8859-2 (Central Europe) 804 \li iso-8859-4 (Baltic) 805 \li iso-8859-5 (Cyrillic) 806 \li iso-8859-7 (Greek) 807 \li iso-8859-9 (Turkish) 808 \li iso-8859-11 (Thai) 809 \li iso-8859-15 (Western Europe) 810 \li iso-8859-16 (Central Europe) 811 \li koi8-r (Russian) 812 \li koi8-u (Ukrainian) 813 814 Of course, the font must contain the characters corresponding to the chosen encoding. 815 The encodings which begin with cp are those used by Windows; Linux systems usually use ISO. 816 Remark: the standard fonts use cp1252. 817 818 \b Note: For TrueType Unicode and OpenType Unicode fonts this parameter is ignored. 819 </td></tr> 820 <tr><td valign="top"><tt>-p patch</tt></td><td>patch file for individual encoding changes. 821 Use the same format as the <tt>.map</tt> files for encodings. 822 A patch file gives the possibility to alter the encoding. 823 Sometimes you may want to add some characters. For instance, ISO-8859-1 does not contain 824 the euro symbol. To add it at position 164, create a file containing the line 825 <p><tt>!A0 U+20AC Euro</tt> 826 <p>\b Note: The Unicode character id will not be interpreted. 827 828 For TrueType Unicode and OpenType Unicode fonts this parameter is ignored. 829 </td></tr> 830 <tr><td><tt>-t {ttf|otf|t1}</tt></td><td>font type (ttf = TrueType, otf = OpenType, t1 = Type1). Only needed if omitting the font file.</td></tr> 831 <tr><td><tt>-o outdir</tt></td><td>the output directory for all generated files (default: current working directory)</td></tr> 832 </table> 833 834 \b Note: in the case of a font with the same name as a standard one, for instance arial.ttf, 835 it is mandatory to embed. If you don't, Acrobat will use its own font. 836 837 Executing <tt>makefont</tt> generates an .xml file, with the same name as the 838 <tt>.afm</tt> file resp. <tt>.ufm</tt> file. You may rename it if you wish. In case of 839 embedding the font file is compressed and gives a file with <tt>.z</tt> as extension. 840 For <b>Unicode TrueType</b> fonts a file with extension <tt>.ctg.z</tt> is created containing 841 the character to glyph mapping.You may rename these files, too, but in this case you have to 842 alter the file name(s) in the file tag in the <tt>.xml</tt> file accordingly. 843 844 You have to copy the generated file(s) to the font directory. 845 846 \section mkfontdecl Declaration of the font in the script 847 848 The last step is the most simple. You just need to call the AddFont() method. For instance: 849 850 <tt>pdf.AddFont(wxS("Comic"),wxS(""),wxS("comic.xml"));</tt> 851 852 or simply: 853 854 <tt>pdf.AddFont(wxS("Comic"));</tt> 855 856 And the font is now available (in regular and underlined styles), usable like the others. 857 If we had worked with Comic Sans MS Bold (comicbd.ttf), we would have put: 858 859 <tt>pdf.AddFont(wxS("Comic"),wxS("B"),wxS("comicbd.xml"));</tt> 860 861 \section mkfontreduce Reducing the size of TrueType fonts 862 863 Font files are often quite voluminous; this is due to the 864 fact that they contain the characters corresponding to many encodings. zlib compression 865 reduces them but they remain fairly big. A technique exists to reduce them further. 866 It consists in converting the font to the \b Type1 format with <tt>ttf2pt1</tt> by specifying the 867 encoding you are interested in; all other characters will be discarded. 868 For instance, the arial.ttf font shipped with Windows 98 is 267KB (it contains 1296 869 characters). After compression it gives 147. Let's convert it to \b Type1 by keeping 870 only cp1250 characters: 871 872 <tt>ttf2ufm -b -L cp1250.map c:/windows/fonts/arial.ttf arial </tt> 873 874 The <tt>.map</tt> files are located in the <tt>makefont</tt> directory. 875 The command produces arial.pfb and arial.afm. The arial.pfb file is only 35KB, 876 and 30KB after compression. 877 878 It is possible to go even further. If you are interested only in a subset of the 879 encoding (you probably don't need all 217 characters), you can open the .map file 880 and remove the lines you are not interested in. This will reduce the file size 881 accordingly. 882 883 Since wxPdfDocument version 0.8.0 automatic font subsetting is supported for 884 TrueType und TrueType Unicode fonts. Since version 0.8.5 subsetting of OpenType Unicode 885 fonts is supported as well. <b>Note</b>: The font license must allow embedding and 886 subsetting. 887 */ 888 889 /** \page showfont ShowFont Utility 890 891 \b ShowFont can be used to generate font samples in PDF form showing the Unicode 892 coverage of the font similar in appearance to the Unicode charts. The concept of 893 this application is based on <a href="http://fntsample.sourceforge.net">FntSample</a>, 894 developed by Eugeniy Meshcheryakov for use with <a href="http://dejavu-fonts.org">DejaVu Fonts</a> 895 project, but the code is written from scratch in C++ using <a href="http://www.wxwidgets.org">wxWidgets</a> 896 and wxPdfDocument. 897 898 \section useshowfont Usage 899 900 <tt>showfont -f FONTFILE -o OUTPUTFILE [-n FONTINDEX] [-e ENCODING] [-i RANGES] [-x RANGES]</tt> 901 902 <tt>showfont { -h | --help }</tt> 903 904 <table border=0> 905 <tr><td valign="top"><tt>-f FONTFILE</tt></td><td>The font file for which a sample should be generated. 906 It can be the name of a \b TrueType, \b OpenType or \b Type1 font file, but wxPdfDocument's 907 font description files are supported, too.</td></tr> 908 <tr><td valign="top"><tt>-o OUTFILE</tt></td><td>The name of the file to which the PDF output is written. 909 \note It should have the extension \b .pdf.</td></tr> 910 <tr><td valign="top"><tt>-n INDEX</tt></td><td>The index of the font within the FONTFILE in case of 911 TrueType Collections (.ttc) which contain multiple fonts. By default font with index 0 is used.</td></tr> 912 913 <tr><td valign="top"><tt>-e ENCODING</tt></td><td>the font encoding of the font. 914 \note This option is required only for \b Type1 fonts and is ignored for other font types. 915 916 The encoding defines the association between a code (from 0 to 255) and an Unicode character. 917 The first 128 are fixed and correspond to ASCII; the next 128 are variable. The following 918 encodings are supported by \b ShowFont: 919 920 <table border="0"> 921 <tr bgcolor="#6699dd"><td><b>Encoding</b></td><td><b>Description</b></td><td> </td><td><b>Encoding</b></td><td><b>Description</b></td></tr> 922 <tr bgcolor="#eeeeee"><td><tt>standard</tt></td><td>Adobe standard Latin encoding</td><td> </td><td><tt>iso-8859-1</tt></td><td>Western European / Latin-1</td></tr> 923 <tr bgcolor="#ddeeff"><td><tt>winansi</tt></td><td>Windows ANSI aka Windows Code Page 1252</td><td> </td><td><tt>iso-8859-2</tt></td><td>Central European / Latin-2</td></tr> 924 <tr bgcolor="#eeeeee"><td><tt>macroman</tt></td><td>Mac OS encoding for Latin</td><td> </td><td><tt>iso-8859-3</tt></td><td>South European / Latin-3</td></tr> 925 <tr bgcolor="#ddeeff"><td><tt>symbol</tt></td><td>Symbol set encoding</td><td> </td><td><tt>iso-8859-4</tt></td><td>Baltic</td></tr> 926 <tr bgcolor="#eeeeee"><td><tt>zapfdingbats</tt></td><td>ZapfDingbats encoding</td><td> </td><td><tt>iso-8859-5</tt></td><td>Cyrillic</td></tr> 927 <tr bgcolor="#ddeeff"><td><tt>cp-1250</tt></td><td>Central and East European Latin</td><td> </td><td><tt>iso-8859-6</tt></td><td>Arabic</td></tr> 928 <tr bgcolor="#eeeeee"><td><tt>cp-1251</tt></td><td>Cyrillic</td><td> </td><td><tt>iso-8859-7</tt></td><td>Greek</td></tr> 929 <tr bgcolor="#ddeeff"><td><tt>cp-1252</tt></td><td>Western European Latin</td><td> </td><td><tt>iso-8859-8</tt></td><td>Hebrew</td></tr> 930 <tr bgcolor="#eeeeee"><td><tt>cp-1253</tt></td><td>Greek</td><td> </td><td><tt>iso-8859-9</tt></td><td>Turkish</td></tr> 931 <tr bgcolor="#ddeeff"><td><tt>cp-1254</tt></td><td>Turkish</td><td> </td><td><tt>iso-8859-10</tt></td><td>Nordic</td></tr> 932 <tr bgcolor="#eeeeee"><td><tt>cp-1255</tt></td><td>Hebrew</td><td> </td><td><tt>iso-8859-11</tt></td><td>Thai</td></tr> 933 <tr bgcolor="#ddeeff"><td><tt>cp-1256</tt></td><td>Arabic</td><td> </td><td><tt>iso-8859-13</tt></td><td>Baltic Rim</td></tr> 934 <tr bgcolor="#eeeeee"><td><tt>cp-1257</tt></td><td>Baltic</td><td> </td><td><tt>iso-8859-14</tt></td><td>Celtic</td></tr> 935 <tr bgcolor="#ddeeff"><td><tt>cp-1258</tt></td><td>Vietnamese</td><td> </td><td><tt>iso-8859-15</tt></td><td>Western European / Latin-9</td></tr> 936 <tr bgcolor="#eeeeee"><td><tt>cp-874</tt></td><td>Thai</td><td> </td><td><tt>iso-8859-16</tt></td><td>South Eastern European / Latin-10</td></tr> 937 <tr bgcolor="#ddeeff"><td><tt>cp-932</tt></td><td>Japanese</td><td> </td><td><tt>koi8-r</tt></td><td>Russian</td></tr> 938 <tr bgcolor="#eeeeee"><td><tt>cp-936</tt></td><td>Simplified Chinese</td><td> </td><td><tt>koi8-u</tt></td><td>Ukrainian</td></tr> 939 <tr bgcolor="#ddeeff"><td><tt>cp-949</tt></td><td>Korean</td><td> </td><td></td><td></td></tr> 940 <tr bgcolor="#eeeeee"><td><tt>cp-950</tt></td><td>Traditional Chinese</td><td> </td><td></td><td></td></tr> 941 </table> 942 943 </td></tr> 944 945 <tr><td valign="top"><tt>-i RANGES</tt></td><td>Show character codes in RANGES. (see \ref showfontranges)</td></tr> 946 <tr><td valign="top"><tt>-x RANGES</tt></td><td>Don't show character codes in RANGES. (see \ref showfontranges)</td></tr> 947 948 <tr><td valign="top"><tt>-h | --help</tt></td><td>Display a usage information and exit.</td></tr> 949 </table> 950 951 \section showfontranges Ranges 952 953 The parameter RANGES for \b -i (--include-range) and \b -x (--exclude-range) can be given 954 as a list of one or more ranges delimited by a comma (,). 955 956 Each range can be given as a single integer or a pair of integers delimited by minus sign (-). 957 958 Integers can be specified in decimal, hexadecimal (0x...) or octal (0...) format. 959 960 One integer of a pair can be omitted (-N specifies all characters with codes less or equal 961 to N, and N- all characters with codes greater or equal to N). 962 963 \section showfontcolour Colours 964 965 Character code cells can have one of several background colours: 966 967 \li <tt>white</tt> = the character code is present in the font, 968 \li <tt>light grey</tt> = the character code is defined in Unicode but not present in the font, 969 \li <tt>blue-grey</tt> = the character code is a control character, 970 \li <tt>dark grey</tt> = the character code is not defined in Unicode. 971 972 \section showfontexample Examples 973 974 Show all character codes of myfont.ttf in output file myfont.pdf: 975 976 <tt>showfont -f myfont.ttf -o myfont.pdf</tt> 977 978 Show all character codes of myfont.ttf less than or equal to U+05FF 979 but exclude U+0300-U+036F in output file myfont.pdf: 980 981 <tt>showfont -f myfont.ttf -o myfont.pdf -i -0x05FF -x 0x0300-0x036F</tt> 982 983 */ 984 985 /** \page writexml Styling text using a simple markup language 986 \section tagoverview Overview 987 988 The method wxPdfDocument::WriteXML allows to write text to PDF using a simple markup language. 989 This allows for example to change font attributes within a cell, which is not supported by 990 methods like wxPdfDocument::WriteCell or wxPdfDocument::MultiCell. The supported markup 991 language consists of a small subset of HTML. Although the subset might be extended in future 992 versions of \b wxPdfDocument, it is not the goal of this method to allow to convert 993 full fledged HTML pages to PDF. 994 995 \b Important! The XML dialect used is very strict. Each tag must have a corresponding closing tag 996 and all attribute values must be enclosed in double quotes. 997 998 Usually the current position should be at the left margin when calling wxPdfDocument::WriteXML. 999 If the current position is \b not at left margin and the text passed to wxPdfDocument::WriteXML 1000 occupies more than a single line, you may get strange results. Until version \b 1.0 of wxPdfDocument 1001 will be released the behaviour of wxPdfDocument::WriteXML might change without prior notice. 1002 1003 Currently there is only limited error handling. You will get strange results or no results at all 1004 if tags are incorrectly used. Unknown tags and all their content are silently ignored. 1005 1006 \section tagref Reference of supported tags 1007 1008 The following sections describe the tags supported by the wxPdfDocument markup language. 1009 1010 \subsection simpletags Simple text markup 1011 1012 There are several tags to influence the size and weight of the font used for displaying the text 1013 and the relative vertical position within a line: 1014 1015 <table border="0"> 1016 <tr bgcolor="#6699dd"><td><b>Tag</b></td><td><b>Description</b></td></tr> 1017 <tr bgcolor="#eeeeee"><td><tt><b> ... </b></tt></td><td>bold text</td></tr> 1018 <tr bgcolor="#ddeeff"><td><tt><i> ... </i></tt></td><td>italic text</td></tr> 1019 <tr bgcolor="#eeeeee"><td><tt><u> ... </u></tt></td><td>underlined text</td></tr> 1020 <tr bgcolor="#ddeeff"><td><tt><o> ... </o></tt></td><td>overlined text</td></tr> 1021 <tr bgcolor="#eeeeee"><td><tt><s> ... </s></tt></td><td>strike-through text</td></tr> 1022 <tr bgcolor="#ddeeff"><td><tt><strong> ... </strong></tt></td><td>bold text (same as <tt><b></tt>)</td></tr> 1023 <tr bgcolor="#eeeeee"><td><tt><em> ... </em></tt></td><td>emphasized text (same as <tt><i></tt>)</td></tr> 1024 <tr bgcolor="#ddeeff"><td><tt><small> ... </small></tt></td><td>text with reduced font size</td></tr> 1025 <tr bgcolor="#eeeeee"><td><tt><sup> ... </sup></tt></td><td>superscripted text</td></tr> 1026 <tr bgcolor="#ddeeff"><td><tt><sub> ... </sub></tt></td><td>subscripted text</td></tr> 1027 <tr bgcolor="#eeeeee"><td><tt><h1> ... </h1></tt></td><td>headline level 1</td></tr> 1028 <tr bgcolor="#ddeeff"><td><tt><h2> ... </h2></tt></td><td>headline level 2</td></tr> 1029 <tr bgcolor="#eeeeee"><td><tt><h3> ... </h3></tt></td><td>headline level 3</td></tr> 1030 <tr bgcolor="#ddeeff"><td><tt><h4> ... </h4></tt></td><td>headline level 4</td></tr> 1031 <tr bgcolor="#eeeeee"><td><tt><h5> ... </h5></tt></td><td>headline level 5</td></tr> 1032 <tr bgcolor="#ddeeff"><td><tt><h6> ... </h6></tt></td><td>headline level 6</td></tr> 1033 </table> 1034 1035 \subsection structtags Structuring text markup 1036 1037 Some tags for structuring the text layout are available. Most of these tags have one or more 1038 attributes to change its properties. Click on the tag description to see a detailed description 1039 of the attributes. 1040 1041 <table border="0"> 1042 <tr bgcolor="#6699dd"><td><b>Tag</b></td><td><b>Description</b></td></tr> 1043 <tr bgcolor="#eeeeee"><td><tt><ul> ... </ul></tt></td><td>\ref ulist</td></tr> 1044 <tr bgcolor="#ddeeff"><td><tt><ol> ... </ol></tt></td><td>\ref olist</td></tr> 1045 <tr bgcolor="#eeeeee"><td><tt><li> ... </li></tt></td><td><b>List item</b> of an ordered or unordered list</td></tr> 1046 <tr bgcolor="#ddeeff"><td><tt><br /></tt></td><td><b>Line break</b>, positions the current position to the left margin of the next line</td></tr> 1047 <tr bgcolor="#eeeeee"><td><tt><p> ... </p></tt></td><td>\ref ptag</td></tr> 1048 <tr bgcolor="#ddeeff"><td><tt><hr /></tt></td><td>\ref hrtag</td></tr> 1049 <tr bgcolor="#eeeeee"><td><tt><a> ... </a></tt></td><td>\ref atag</td></tr> 1050 <tr bgcolor="#ddeeff"><td><tt><font> ... </font></tt></td><td>\ref fonttag</td></tr> 1051 <tr bgcolor="#eeeeee"><td><tt><table> ... </table></tt></td><td>\ref tabletag</td></tr> 1052 </table> 1053 1054 \subsection misctags Miscelleaneous text markup 1055 1056 This section lists a few additional tags not fitting in any other category. 1057 Click on the tag description to see a detailed description of the attributes. 1058 1059 <table border="0"> 1060 <tr bgcolor="#6699dd"><td><b>Tag</b></td><td><b>Description</b></td></tr> 1061 <tr bgcolor="#eeeeee"><td><tt><msg> ... </msg></tt></td><td>\ref msgtag</td></tr> 1062 <tr bgcolor="#ddeeff"><td><tt><img ... /></tt></td><td>\ref imgtag</td></tr> 1063 </table> 1064 1065 \subsection ulist Unordered lists 1066 1067 Unordered lists start on a new line. Each list item is preceded by a list item marker and the content of the 1068 list item is indented. 1069 1070 <table border="0"> 1071 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1072 <tr bgcolor="#eeeeee"><td colspan="2"><b><ul></b></td></tr> 1073 <tr bgcolor="#6699dd"><td><b>Attribute</b></td><td><b>Description</b></td></tr> 1074 <tr bgcolor="#eeeeee"><td valign="top"><tt>type="bullet|dash|<i>number</i>"</tt></td><td>Sets the type of the list item marker 1075 <p><tt><b>bullet</b></tt> displays a bullet character</p> 1076 <p><tt><b>dash</b></tt> displays a dash character</p> 1077 <p><tt><i>number</i></tt> has a value between 0 and 255. The corresponding character of the \b ZapfDingBats font 1078 is used as the list item marker</p></td></tr> 1079 </table> 1080 1081 \subsection olist Ordered lists 1082 1083 Ordered lists start on a new line. Each list item is preceded by a list item enumerator and the content of the 1084 list item is indented. 1085 1086 <table border="0"> 1087 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1088 <tr bgcolor="#eeeeee"><td colspan="2"><b><ol></b></td></tr> 1089 <tr bgcolor="#6699dd"><td><b>Attribute</b></td><td><b>Description</b></td></tr> 1090 <tr bgcolor="#eeeeee"><td valign="top"><tt>type="1|a|A|i|I|z1|z2|z3|z4"</tt></td><td>Sets the type of the list item enumerator 1091 <p><tt><b>1</b></tt> displays a decimal number as the list item enumerator</p> 1092 <p><tt><b>a</b></tt> displays a lowercase alphabetic character as the list item enumerator</p> 1093 <p><tt><b>A</b></tt> displays a uppercase alphabetic character as the list item enumerator</p> 1094 <p><tt><b>i</b></tt> displays a lowercase roman number as the list item enumerator</p> 1095 <p><tt><b>I</b></tt> displays a uppercase roman number as the list item enumerator</p> 1096 <p><tt><b>z1|z2|z3|z4</b></tt> displays number symbols of one of the 4 number series in the \b ZapfDingBats font. This option should only be used for lists of at most 10 items.</p> 1097 </td></tr> 1098 <tr bgcolor="#ddeeff"><td><tt>start="<i>number</i>"</tt></td><td><i>number</i> represents the enumerator value of the first list item</td></tr> 1099 </table> 1100 1101 \subsection ptag Paragraph 1102 1103 A paragraph starts on a new line and forces an empty line after the closing paragraph tag. 1104 1105 <table border="0"> 1106 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1107 <tr bgcolor="#eeeeee"><td colspan="2"><b><p></b></td></tr> 1108 <tr bgcolor="#6699dd"><td><b>Attribute</b></td><td><b>Description</b></td></tr> 1109 <tr bgcolor="#eeeeee"><td valign="top"><tt>align="left|right|center|justify"</tt></td><td>As specified by this 1110 option the content of the paragraph will be \b left or \b right aligned, \b centered or \b justified. 1111 The default is \b left aligned.</td></tr> 1112 </table> 1113 1114 \subsection hrtag Horizontal rule 1115 1116 A horizontal rule is a line of specified width which is drawn on a separate line. 1117 1118 <table border="0"> 1119 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1120 <tr bgcolor="#eeeeee"><td colspan="2"><b><hr></b></td></tr> 1121 <tr bgcolor="#6699dd"><td><b>Attribute</b></td><td><b>Description</b></td></tr> 1122 <tr bgcolor="#eeeeee"><td valign="top"><tt>width="<i>number</i>"</tt></td><td>The width of the horizontal rule 1123 is an integer <i>number</i> between 1 and 100 giving the width in percent of the available width (from left to right margin). 1124 The default value is 100.</td></tr> 1125 </table> 1126 1127 \subsection atag Internal or external link 1128 1129 An internal or external link is displayed as blue underlined text. Clicking on the text opens a browser window 1130 loading the referenced URL. 1131 1132 <table border="0"> 1133 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1134 <tr bgcolor="#eeeeee"><td colspan="2"><b><a></b></td></tr> 1135 <tr bgcolor="#6699dd"><td><b>Attribute</b></td><td><b>Description</b></td></tr> 1136 <tr bgcolor="#eeeeee"><td><tt>href="<i>url</i>"</tt></td><td><i>url</i> is an unified resource locator. 1137 If <i>url</i> starts with <b>#</b> it is interpreted as a reference to an internal link anchor; 1138 the characters following <b>#</b> are used as the name of the anchor.</td></tr> 1139 <tr bgcolor="#6699dd"><td><tt>name="<i>anchor</i>"</tt></td><td><i>anchor</i> is the name of an internal link anchor.</td></tr> 1140 </table> 1141 1142 <b>Note:</b> Either the <b><tt>name</tt></b> or the <b><tt>href</tt></b> attribute may be specified, but not both. 1143 1144 \subsection fonttag Font specification 1145 1146 This tag allows to specify several font attributes for the embedded content. Font family, 1147 font size and colour can be set. Attributes not given retain their previous value. 1148 1149 <table border="0"> 1150 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1151 <tr bgcolor="#eeeeee"><td colspan="2"><b><font></b></td></tr> 1152 <tr bgcolor="#6699dd"><td><b>Attribute</b></td><td><b>Description</b></td></tr> 1153 <tr bgcolor="#eeeeee"><td valign="top"><tt>face="<i>fontfamily</i>"</tt></td><td>The name of the font family. It can be the name of one of the 1154 14 core fonts or the name of a font previously added by wxPdfDocument::AddFont.</td></tr> 1155 <tr bgcolor="#ddeeff"><td><tt>size="<i>fontsize</i>"</tt></td><td>The font size in points</td></tr> 1156 <tr bgcolor="#eeeeee"><td><tt>color="<i>fontcolour</i>"</tt></td><td>The font colour in HTML notation, i.e. <b><i>\#rrggbb</i></b>, 1157 or as a named colour, i.e. <b><i>red</i></b>.</td></tr> 1158 </table> 1159 1160 \subsection msgtag Translatable text 1161 1162 For international applications a simple mechanism is provided to pass a string to <b><code>wxGetTranslation</code></b>. 1163 1164 <table border="0"> 1165 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1166 <tr bgcolor="#eeeeee"><td colspan="2"><b><msg></b></td></tr> 1167 </table> 1168 1169 The text string included in the <b><tt>msg</tt></b> tag will be translated if a translation is available before it is written to PDF. 1170 1171 <b>Note:</b> Within the <b><tt>msg</tt></b> tag additional markup is not allowed. 1172 1173 \subsection imgtag Images 1174 1175 In the current implementation output of an image always starts on a new line. 1176 1177 <table border="0"> 1178 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1179 <tr bgcolor="#eeeeee"><td colspan="2"><b><img></b></td></tr> 1180 <tr bgcolor="#6699dd"><td><b>Attribute</b></td><td><b>Description</b></td></tr> 1181 <tr bgcolor="#eeeeee"><td valign="top"><tt>src="<i>imagefile</i>"</tt></td><td>The name of the image file.</td></tr> 1182 <tr bgcolor="#ddeeff"><td valign="top"><tt>width="<i>image width</i>"</tt></td><td>The width of the image measured in pixels.</td></tr> 1183 <tr bgcolor="#eeeeee"><td valign="top"><tt>height="<i>image height</i>"</tt></td><td>The height of the image measured in pixels.</td></tr> 1184 <tr bgcolor="#ddeeff"><td valign="top"><tt>align="left|right|center"</tt></td><td>As specified by this 1185 option the image will be \b left or \b right aligned, or \b centered. 1186 The default is \b left aligned.</td></tr> 1187 </table> 1188 1189 \section tabletag Tables 1190 1191 Very often information is presented in a tabular structure. This is also supported by the wxPdfDocument markup language 1192 by using a specific kind of HTML table syntax. The structure is as follows: 1193 <pre> 1194 <table> 1195 <colgroup> 1196 <col ... /> 1197 ... 1198 </colgroup> 1199 <thead> 1200 <tr><td> ... </td></tr> 1201 ... 1202 </thead> 1203 <tbody> 1204 <tr><td> ... </td></tr> 1205 ... 1206 </tbody> 1207 </table> 1208 </pre> 1209 The <b><tt>colgroup</tt></b> tag and embedded <b><tt>col</tt></b> tags are always required since all column widths have to be specified 1210 a priori. <b><tt>width</tt></b> attributes are not interpreted when used in other table tags. 1211 1212 The <b><tt>thead</tt></b> tag and embedded table rows and cells are allowed, but since the current implementation only supports 1213 tables fitting completely on one page, the rows are handled as ordinary rows. (A future release will support tables 1214 spanning more than one page. Header rows will be repeated on each page.) 1215 1216 The use of the <b><tt>tbody</tt></b> tag is always required. 1217 1218 Nested tables are supported. 1219 1220 The <b><tt>table</tt></b> tag may have the following attributes: 1221 1222 <table border="0"> 1223 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1224 <tr bgcolor="#eeeeee"><td colspan="2"><b><table></b></td></tr> 1225 <tr bgcolor="#6699dd"><td><b>Attribute</b></td><td><b>Description</b></td></tr> 1226 <tr bgcolor="#eeeeee"><td valign="top"><tt>border="<i>number</i>"</tt></td><td>Table cells may have borders on each side. 1227 This attribute specifies whether cells will have borders on every side or not. This may be overriden for each individual cell. 1228 The attribute value consists of the combination of up to 4 letters: 1229 <p>\b 0 - no borders<br> 1230 <b> > 0</b> - borders on all sides of each cell<br> 1231 </td></tr> 1232 <tr bgcolor="#ddeeff"><td valign="top"><tt>align="left|right|center"</tt></td><td>Defines the horizontal alignment of the table. Default is the alignment of the surrounding context.</td></tr> 1233 <tr bgcolor="#eeeeee"><td><tt>valign="top|middle|bottom"</tt></td><td>Defines the vertical alignment of the table. Default is <i>top</i>.</td></tr> 1234 <tr bgcolor="#ddeeff"><td valign="top"><tt>cellpadding="<i>number</i>"</tt></td><td><i>Number</i> defines the padding width on each side of a cell. Default is 0.</td></tr> 1235 </table> 1236 1237 The supported tags and their attributes are shown in the following tables: 1238 1239 <table border="0"> 1240 <tr bgcolor="#6699dd"><td><b>Tag</b></td><td><b>Description</b></td></tr> 1241 <tr bgcolor="#eeeeee"><td><tt><table> ... </table></tt></td><td>Groups the definitions of column widths. Contains one or more <col> tags.</td></tr> 1242 <tr bgcolor="#eeeeee"><td><tt><colgroup> ... </colgroup></tt></td><td>Groups the definitions of column widths. Contains one or more <col> tags.</td></tr> 1243 <tr bgcolor="#ddeeff"><td><tt><col width="<i>width</i>" span="<i>number</i>"> ... </col></tt></td><td> 1244 Defines the <i>width</i> of one or more columns. <i>number</i> specifies for how many columns the width is specified, default is 1. 1245 </td></tr> 1246 <tr bgcolor="#eeeeee"><td valign="top"><tt><thead odd="<i>background colour for odd numbered rows</i>" even="<i>background colour for even numbered rows</i>"> ... </thead></tt></td> 1247 <td>Defines a group of table header rows. 1248 Contains one or more <tr> tags. If a table does not fit on a single page these rows are repeated on each page. 1249 The attributes <b><tt>odd</tt></b> and <b><tt>even</tt></b> are optional. 1250 </td></tr> 1251 <tr bgcolor="#ddeeff"><td valign="top"><tt><tbody odd="<i>background colour for odd numbered rows</i>" even="<i>background colour for even numbered rows</i>"> ... </tbody></tt></td> 1252 <td>Defines a group of table body rows. Contains one or more <tr> tags. 1253 The attributes <b><tt>odd</tt></b> and <b><tt>even</tt></b> are optional. 1254 </td></tr> 1255 <tr bgcolor="#eeeeee"><td valign="top"><tt><tr bgcolor="<i>background colour</i>" height="<i>height</i>"> ... </tr></tt></td> 1256 <td>Defines a table row. Contains one or more <td> tags. 1257 <p>The <i>background colour</i> may be specified in HTML notation, i.e. <b><i>\#rrggbb</i></b>, 1258 or as a named colour, i.e. <b><i>red</i></b>. If no background colour is given the background is transparent.</p> 1259 <p>Usually the height of the highest cell in a row is used as the row height, but a minimal row <i>height</i> may be specified, too</p> 1260 </td></tr> 1261 <tr bgcolor="#ddeeff"><td valign="top"><tt><td> ... </td></tt></td><td>Defines a table cell. 1262 <p>The available attributes are described in section \ref tdtag.</p></td></tr> 1263 </table> 1264 1265 \subsection tdtag Table cells 1266 1267 A table cell can have several attributes: 1268 1269 <table border="0"> 1270 <tr bgcolor="#6699dd"><td colspan="2"><b>Tag</b></td></tr> 1271 <tr bgcolor="#eeeeee"><td colspan="2"><b><td></b></td></tr> 1272 <tr bgcolor="#6699dd"><td><b>Attribute</b></td><td><b>Description</b></td></tr> 1273 <tr bgcolor="#eeeeee"><td valign="top"><tt>border="LTBR"</tt></td><td>A cell may have a border on each side. 1274 This attribute overrides the border specification in the <table> tag. The attribute value consists of 1275 the combination of up to 4 letters: 1276 <p>\b L - border on the left side of the cell<br> 1277 \b T - border on the top side of the cell<br> 1278 \b B - border on the bottom side of the cell<br> 1279 \b R - border on the right side of the cell</p> 1280 .</td></tr> 1281 <tr bgcolor="#ddeeff"><td valign="top"><tt>align="left|right|center"</tt></td><td>Defines the horizontal alignment of the cell content. Default is <i>left</i>.</td></tr> 1282 <tr bgcolor="#eeeeee"><td><tt>valign="top|middle|bottom"</tt></td><td>Defines the vertical alignment of the cell content. Default is <i>top</i>.</td></tr> 1283 <tr bgcolor="#ddeeff"><td valign="top"><tt>bgcolor="<i>background colour</i>"</tt></td><td>The background colour of the cell in HTML notation, i.e. <b><i>\#rrggbb</i></b>, 1284 or as a named colour, i.e. <b><i>red</i></b>. This attribute overrides the background colour specification of the row. 1285 If neither a row nor a cell background colour is specified the background is transparent.</td></tr> 1286 <tr bgcolor="#eeeeee"><td valign="top"><tt>rowspan="<i>number</i>"</tt></td><td><i>Number</i> of rows this cell should span. Default is 1.</td></tr> 1287 <tr bgcolor="#ddeeff"><td valign="top"><tt>colspan="<i>number</i>"</tt></td><td><i>Number</i> of columns this cell should span. Default is 1.</td></tr> 1288 </table> 1289 1290 */ 1291 1292 #ifndef _PDFDOC_DEF_H_ 1293 #define _PDFDOC_DEF_H_ 1294 1295 // Unfortunately we can't always just rely on WXEXPORT because it wasn't 1296 // defined correctly when using ELF visibility for symbol hiding in wx 2.8 that 1297 // we still support, so we have to use our own symbol. This part, as well as 1298 // the definition of WXPDFDOC_HAVE_VISIBILITY in configure, should be dropped 1299 // when wx 2.8 is not supported any longer. 1300 #ifdef WXPDFDOC_HAVE_VISIBILITY 1301 #define WXPDFDOC_EXPORT __attribute__ ((visibility("default"))) 1302 #else 1303 #define WXPDFDOC_EXPORT WXEXPORT 1304 #endif 1305 1306 #if defined(WXMAKINGDLL_PDFDOC) 1307 #define WXDLLIMPEXP_PDFDOC WXPDFDOC_EXPORT 1308 #define WXDLLIMPEXP_DATA_PDFDOC(type) WXPDFDOC_EXPORT type 1309 #elif defined(WXUSINGDLL_PDFDOC) 1310 #define WXDLLIMPEXP_PDFDOC WXIMPORT 1311 #define WXDLLIMPEXP_DATA_PDFDOC(type) WXIMPORT type 1312 #else // not making nor using DLL 1313 #define WXDLLIMPEXP_PDFDOC 1314 #define WXDLLIMPEXP_DATA_PDFDOC(type) type 1315 #endif 1316 1317 // Setting inheritance of wxPdfDocument 1318 // 0 = do not derive wxPdfDocument from wxObject (default) 1319 // 1 = derive wxPdfDocumentinherit from wxObject 1320 #ifndef WXPDFDOC_INHERIT_WXOBJECT 1321 #define WXPDFDOC_INHERIT_WXOBJECT 0 1322 #endif 1323 1324 /* 1325 GCC warns about using __declspec on forward declarations 1326 while MSVC complains about forward declarations without 1327 __declspec for the classes later declared with it. To hide this 1328 difference a separate macro for forward declarations is defined: 1329 */ 1330 #if defined(HAVE_VISIBILITY) || (defined(__WINDOWS__) && defined(__GNUC__)) 1331 #define WXDLLIMPEXP_FWD_PDFDOC 1332 #else 1333 #define WXDLLIMPEXP_FWD_PDFDOC WXDLLIMPEXP_PDFDOC 1334 #endif 1335 1336 #endif // _PDFDOC_DEF_H_ 1337