diff --git a/README.md b/README.md index 41b53a7..c7b7bb1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,24 @@ # Pdf -使用tsl生成你的pdf文件 \ No newline at end of file +使用tsl生成你的pdf文件 + +## 部署 + +### funcext + +将`TSPdfEnumerations.tsf`文件部署到tsl安装路径下的`funcext` + +### plugin + +将`plugin`目录下对应动态库部署到tsl安装目录的`plugin` + +## Demo + +demo目录是使用参考的demo,若要执行demo下的tsl生成对应的pdf,则需要部署`demo\InitCmdParams.tsf`到`funcext` + +```c +tsl demo\xxx.tsl --path=D:/code/pdf --alias="" + +--path是控制生成对应pdf的路径 +--alias是别名 +``` \ No newline at end of file diff --git a/TSPdfEnumerations.tsf b/TSPdfEnumerations.tsf new file mode 100644 index 0000000..6b22c02 --- /dev/null +++ b/TSPdfEnumerations.tsf @@ -0,0 +1,714 @@ +unit TSPdfEnumerations; +interface + // HPDF_PageLayout + function PAGE_LAYOUT_SINGLE(); + function PAGE_LAYOUT_ONE_COLUMN(); + function PAGE_LAYOUT_TWO_COLUMN_LEFT(); + function PAGE_LAYOUT_TWO_COLUMN_RIGHT(); + function PAGE_LAYOUT_TWO_PAGE_LEFT(); + function PAGE_LAYOUT_TWO_PAGE_RIGHT(); + function PAGE_LAYOUT_EOF(); + + // HPDF_PageMode + function PAGE_MODE_USE_NODE(); + function PAGE_MODE_USE_OUTLINE(); + function PAGE_MODE_USE_THUMBS(); + function PAGE_MODE_USE_SCREEN(); + function PAGE_MODE_EOF(); + + // HPDF_ColorSpace + function CS_DEVICE_GRAY(); + function CS_DEVICE_RGB(); + function CS_DEVICE_CMYK(); + function CS_CAL_GRAY(); + function CS_CAL_RGB(); + function CS_LAB(); + function CS_ICC_BASED(); + function CS_SEPARATION(); + function CS_DEVICE_N(); + function CS_INDEXED(); + function CS_PATTERN(); + function CS_EOF(); + + // HPDF_InfoType + function INFO_AUTHOR(); + function INFO_CREATOR(); + function INFO_TITLE(); + function INFO_SUBJECT(); + function INFO_KEYWORDS(); + function INFO_CREATION_DATE(); + function INFO_MOD_DATE(); + + // Permission + function ENABLE_READ(); + function ENABLE_PRINT(); + function ENABLE_EDIT_ALL(); + function ENABLE_COPY(); + function ENABLE_EDIT(); + + // HPDF_PageSizes + function PAGE_SIZE_LETTER(); + function PAGE_SIZE_LEGAL(); + function PAGE_SIZE_A3(); + function PAGE_SIZE_A4(); + function PAGE_SIZE_A5(); + function PAGE_SIZE_B4(); + function PAGE_SIZE_B5(); + function PAGE_SIZE_EXECUTIVE(); + function PAGE_SIZE_US4x6(); + function PAGE_SIZE_US4x8(); + function PAGE_SIZE_US5x7(); + function PAGE_SIZE_COMM10(); + function PAGE_SIZE_EOF(); + + // HPDF_PageDirection + function PAGE_PORTRAIT(); + function PAGE_LANDSCAPE(); + + // HPDF_LineCap + function BUTT_END(); + function ROUND_END(); + function PROJECTING_SQUARE_END(); + function LINECAP_EOF(); + + // HPDF_LineJoin + function MITER_JOIN(); + function ROUND_JOIN(); + function BEVEL_JOIN(); + function LINEJOIN_EOF(); + + // HPDF_TextRenderingMode + function FILL(); + function STROKE(); + function FILL_THEN_STROKE(); + function INVISIBLE(); + function FILL_CLIPPING(); + function STROKE_CLIPPING(); + function FILL_STROKE_CLIPPING(); + function CLIPPING(); + function RENDERING_MODE_EOF(); + + // HPDF_CompressionMode + function COMP_NONE(); + function COMP_TEXT(); + function COMP_IMAGE(); + function COMP_METADATA(); + function COMP_ALL(); + + // HPDF_EncryptMode + function ENCRYPT_R2(); + function ENCRYPT_R3(); + + // HPDF_TextAlignment + function TALIGN_LEFT(); + function TALIGN_RIGHT(); + function TALIGN_CENTER(); + function TALIGN_JUSTIFY(); + + // HPDF_EncoderType + function ENCODER_TYPE_SINGLE_BYTE(); + function ENCODER_TYPE_DOUBLE_BYTE(); + function ENCODER_TYPE_UNINITIALIZED(); + function ENCODER_UNKNOWN(); + + // HPDF_ByteType + function BYTE_TYPE_SINGLE(); + function BYTE_TYPE_LEAD(); + function BYTE_TYPE_TRAIL(); + function BYTE_TYPE_UNKNOWN(); + + // HPDF_WritingMode + function WMODE_HORIZONTAL(); + function WMODE_VERTICAL(); + function WMODE_EOF(); + + // HPDF_AnnotHighlightMode + function ANNOT_NO_HIGHTLIGHT(); + function ANNOT_INVERT_BOX(); + function ANNOT_INVERT_BORDER(); + function ANNOT_DOWN_APPEARANCE(); + function ANNOT_HIGHTLIGHT_MODE_EOF(); + + // HPDF_AnnotIcon + function ANNOT_ICON_COMMENT(); + function ANNOT_ICON_KEY(); + function ANNOT_ICON_NOTE(); + function ANNOT_ICON_HELP(); + function ANNOT_ICON_NEW_PARAGRAPH(); + function ANNOT_ICON_PARAGRAPH(); + function ANNOT_ICON_INSERT(); + function ANNOT_ICON_EOF(); + + // HPDF_BSSubtype + function BS_SOLID(); + function BS_DASHED(); + function BS_BEVELED(); + function BS_INSET(); + function BS_UNDERLINED(); + + // HPDF_TransitionStyle + function TS_WIPE_RIGHT(); + function TS_WIPE_UP(); + function TS_WIPE_LEFT(); + function TS_WIPE_DOWN(); + function TS_BARN_DOORS_HORIZONTAL_OUT(); + function TS_BARN_DOORS_HORIZONTAL_IN(); + function TS_BARN_DOORS_VERTICAL_OUT(); + function TS_BARN_DOORS_VERTICAL_IN(); + function TS_BOX_OUT(); + function TS_BOX_IN(); + function TS_BLINDS_HORIZONTAL(); + function TS_BLINDS_VERTICAL(); + function TS_DISSOLVE(); + function TS_GLITTER_RIGHT(); + function TS_GLITTER_DOWN(); + function TS_GLITTER_TOP_LEFT_TO_BOTTOM_RIGHT(); + function TS_REPLACE(); + function TS_EOF(); + +implementation + // HPDF_PageLayout + function PAGE_LAYOUT_SINGLE(); + begin + return 0; + end; + function PAGE_LAYOUT_ONE_COLUMN(); + begin + return 1; + end; + function PAGE_LAYOUT_TWO_COLUMN_LEFT(); + begin + return 2; + end; + function PAGE_LAYOUT_TWO_COLUMN_RIGHT(); + begin + return 3; + end; + function PAGE_LAYOUT_TWO_PAGE_LEFT(); + begin + return 4; + end; + function PAGE_LAYOUT_TWO_PAGE_RIGHT(); + begin + return 5; + end; + function PAGE_LAYOUT_EOF(); + begin + return 6; + end; + + // HPDF_PageMode + function PAGE_MODE_USE_NODE(); + begin + return 0; + end; + function PAGE_MODE_USE_OUTLINE(); + begin + return 1; + end; + function PAGE_MODE_USE_THUMBS(); + begin + return 2; + end; + function PAGE_MODE_USE_SCREEN(); + begin + return 3; + end; + function PAGE_MODE_EOF(); + begin + return 4; + end; + + // HPDF_ColorSpace + function CS_DEVICE_GRAY(); + begin + return 0; + end; + function CS_DEVICE_RGB(); + begin + return 1; + end; + function CS_DEVICE_CMYK(); + begin + return 2; + end; + function CS_CAL_GRAY(); + begin + return 3; + end; + function CS_CAL_RGB(); + begin + return 4; + end; + function CS_LAB(); + begin + return 5; + end; + function CS_ICC_BASED(); + begin + return 6; + end; + function CS_SEPARATION(); + begin + return 7; + end; + function CS_DEVICE_N(); + begin + return 8; + end; + function CS_INDEXED(); + begin + return 9; + end; + function CS_PATTERN(); + begin + return 10; + end; + function CS_EOF(); + begin + return 11; + end; + + // HPDF_InfoType + function INFO_AUTHOR(); + begin + return "AUTHOR"; + end; + function INFO_CREATOR(); + begin + return "CREATOR"; + end; + function INFO_TITLE(); + begin + return "TITLE"; + end; + function INFO_SUBJECT(); + begin + return "SUBJECT"; + end; + function INFO_KEYWORDS(); + begin + return "KEYWORDS"; + end; + function INFO_CREATION_DATE(); + begin + return "CREATION_DATE"; + end; + function INFO_MOD_DATE(); + begin + return "MOD_DATE"; + end; + + // Permission + function ENABLE_READ(); + begin + return 0; + end; + function ENABLE_PRINT(); + begin + return 4; + end; + function ENABLE_EDIT_ALL(); + begin + return 8; + end; + function ENABLE_COPY(); + begin + return 16; + end; + function ENABLE_EDIT(); + begin + return 32; + end; + + // HPDF_PageSizes + function PAGE_SIZE_LETTER(); + begin + return 0; + end; + function PAGE_SIZE_LEGAL(); + begin + return 1; + end; + function PAGE_SIZE_A3(); + begin + return 2; + end; + function PAGE_SIZE_A4(); + begin + return 3; + end; + function PAGE_SIZE_A5(); + begin + return 4; + end; + function PAGE_SIZE_B4(); + begin + return 5; + end; + function PAGE_SIZE_B5(); + begin + return 6; + end; + function PAGE_SIZE_EXECUTIVE(); + begin + return 7; + end; + function PAGE_SIZE_US4x6(); + begin + return 8; + end; + function PAGE_SIZE_US4x8(); + begin + return 9; + end; + function PAGE_SIZE_US5x7(); + begin + return 10; + end; + function PAGE_SIZE_COMM10(); + begin + return 11; + end; + function PAGE_SIZE_EOF(); + begin + return 12; + end; + + // HPDF_PageDirection + function PAGE_PORTRAIT(); + begin + return 0; + end; + function PAGE_LANDSCAPE(); + begin + return 1; + end; + + // HPDF_LineCap + function BUTT_END(); + begin + return 0; + end; + function ROUND_END(); + begin + return 1; + end; + function PROJECTING_SQUARE_END(); + begin + return 2; + end; + function LINECAP_EOF(); + begin + return 3; + end; + + // HPDF_LineJoin + function MITER_JOIN(); + begin + return 0; + end; + function ROUND_JOIN(); + begin + return 1; + end; + function BEVEL_JOIN(); + begin + return 2; + end; + function LINEJOIN_EOF(); + begin + return 3; + end; + + // HPDF_TextRenderingMode + function FILL(); + begin + return 0; + end; + function STROKE(); + begin + return 1; + end; + function FILL_THEN_STROKE(); + begin + return 2; + end; + function INVISIBLE(); + begin + return 3; + end; + function FILL_CLIPPING(); + begin + return 4; + end; + function STROKE_CLIPPING(); + begin + return 5; + end; + function FILL_STROKE_CLIPPING(); + begin + return 6; + end; + function CLIPPING(); + begin + return 7; + end; + function RENDERING_MODE_EOF(); + begin + return 8; + end; + + // HPDF_CompressionMode + function COMP_NONE(); + begin + return 0x00; + end; + function COMP_TEXT(); + begin + return 0x01; + end; + function COMP_IMAGE(); + begin + return 0x02; + end; + function COMP_METADATA(); + begin + return 0x04; + end; + function COMP_ALL(); + begin + return 0x0F; + end; + + // HPDF_EncryptMode + function ENCRYPT_R2(); + begin + return 2; + end; + function ENCRYPT_R3(); + begin + return 3; + end; + + // HPDF_TextAlignment + function TALIGN_LEFT(); + begin + return 0; + end; + function TALIGN_RIGHT(); + begin + return 1; + end; + function TALIGN_CENTER(); + begin + return 2; + end; + function TALIGN_JUSTIFY(); + begin + return 3; + end; + + // HPDF_EncoderType + function ENCODER_TYPE_SINGLE_BYTE(); + begin + return 0; + end; + function ENCODER_TYPE_DOUBLE_BYTE(); + begin + return 1; + end; + function ENCODER_TYPE_UNINITIALIZED(); + begin + return 2; + end; + function ENCODER_UNKNOWN(); + begin + return 3; + end; + + // HPDF_ByteType + function BYTE_TYPE_SINGLE(); + begin + return 0; + end; + function BYTE_TYPE_LEAD(); + begin + return 1; + end; + function BYTE_TYPE_TRAIL(); + begin + return 2; + end; + function BYTE_TYPE_UNKNOWN(); + begin + return 3; + end; + + // HPDF_WritingMode + function WMODE_HORIZONTAL(); + begin + return 0; + end; + function WMODE_VERTICAL(); + begin + return 1; + end; + function WMODE_EOF(); + begin + return 2; + end; + + // HPDF_AnnotHighlightMode + function ANNOT_NO_HIGHTLIGHT(); + begin + return 0; + end; + function ANNOT_INVERT_BOX(); + begin + return 1; + end; + function ANNOT_INVERT_BORDER(); + begin + return 2; + end; + function ANNOT_DOWN_APPEARANCE(); + begin + return 3; + end; + function ANNOT_HIGHTLIGHT_MODE_EOF(); + begin + return 4; + end; + + // HPDF_AnnotIcon + function ANNOT_ICON_COMMENT(); + begin + return 0; + end; + function ANNOT_ICON_KEY(); + begin + return 1; + end; + function ANNOT_ICON_NOTE(); + begin + return 2; + end; + function ANNOT_ICON_HELP(); + begin + return 3; + end; + function ANNOT_ICON_NEW_PARAGRAPH(); + begin + return 4; + end; + function ANNOT_ICON_PARAGRAPH(); + begin + return 5; + end; + function ANNOT_ICON_INSERT(); + begin + return 6; + end; + function ANNOT_ICON_EOF(); + begin + return 7; + end; + + // HPDF_BSSubtype + function BS_SOLID(); + begin + return 0; + end; + function BS_DASHED(); + begin + return 1; + end; + function BS_BEVELED(); + begin + return 2; + end; + function BS_INSET(); + begin + return 3; + end; + function BS_UNDERLINED(); + begin + return 4; + end; + + // HPDF_TransitionStyle + function TS_WIPE_RIGHT(); + begin + return 0; + end; + function TS_WIPE_UP(); + begin + return 1; + end; + function TS_WIPE_LEFT(); + begin + return 2; + end; + function TS_WIPE_DOWN(); + begin + return 3; + end; + function TS_BARN_DOORS_HORIZONTAL_OUT(); + begin + return 4; + end; + function TS_BARN_DOORS_HORIZONTAL_IN(); + begin + return 5; + end; + function TS_BARN_DOORS_VERTICAL_OUT(); + begin + return 6; + end; + function TS_BARN_DOORS_VERTICAL_IN(); + begin + return 7; + end; + function TS_BOX_OUT(); + begin + return 8; + end; + function TS_BOX_IN(); + begin + return 9; + end; + function TS_BLINDS_HORIZONTAL(); + begin + return 10; + end; + function TS_BLINDS_VERTICAL(); + begin + return 11; + end; + function TS_DISSOLVE(); + begin + return 12; + end; + function TS_GLITTER_RIGHT(); + begin + return 13; + end; + function TS_GLITTER_DOWN(); + begin + return 14; + end; + function TS_GLITTER_TOP_LEFT_TO_BOTTOM_RIGHT(); + begin + return 15; + end; + function TS_REPLACE(); + begin + return 16; + end; + function TS_EOF(); + begin + return 17; + end; + +end. diff --git a/cp.ps1 b/cp.ps1 new file mode 100644 index 0000000..db1e99a --- /dev/null +++ b/cp.ps1 @@ -0,0 +1,12 @@ +$sourcedir = "D:\code\tinysoft\Pdf-dev" +$destdir = "D:\code\tinysoft\Pdf" + +# 复制动态库 +Copy-Item -Path "D:\code\tinysoft\output_libs\Release\TSPDF.dll" ($destdir + "\plugin\windows-x64\") -Force +Copy-Item -Path "D:\code\tinysoft\output_libs\libTSPDF.so" ($destdir + "\plugin\ubuntu-18.04\") -Force + +# 复制tsf脚本 +Remove-Item -Path ($destdir + "\demo\") -Recurse -Force +Remove-Item -Path ($destdir + "\TSPdfEnumerations.tsf") -Force +Copy-Item -Path ($sourcedir + "\demo\") ($destdir + "\demo\") -Recurse -Force +Copy-Item -Path ($sourcedir + "\funcext\Pdf\TSPdfEnumerations.tsf") ($destdir + "\TSPdfEnumerations.tsf") -Force diff --git a/demo/InitCmdParams.tsf b/demo/InitCmdParams.tsf new file mode 100644 index 0000000..fdea8b2 --- /dev/null +++ b/demo/InitCmdParams.tsf @@ -0,0 +1,17 @@ +Function InitCmdParams(alias, path) +Begin + // path := ExtractFileDir(SysparamStr(0)); + for i:=0 to SysParamCount() do + begin + param := Trim(SysparamStr(i)); + arr := Str2Array(param, "="); + if length(arr) = 2 then + begin + if arr[0] = "--path" then + path := arr[1]; + else if arr[0] = '--alias' then + alias := arr[1]; + end + end +End; + diff --git a/demo/arc_demo.pdf b/demo/arc_demo.pdf new file mode 100644 index 0000000..5ff8404 --- /dev/null +++ b/demo/arc_demo.pdf @@ -0,0 +1,687 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 4 0 R ] +/Count 1 +>> +endobj +3 0 obj +<< +/Producer (Haru Free PDF Library 2.4.4) +>> +endobj +4 0 obj +<< +/Type /Page +/MediaBox [ 0 0 200 220 ] +/Contents 5 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 7 0 R +>> +>> +/Parent 2 0 R +>> +endobj +5 0 obj +<< +/Length 6 0 R +>> +stream +/F1 5 Tf +0.5 g +0.8 G +0.5 w +0 0 m +200 0 l +S +0.25 w +0 5 m +200 5 l +S +0.5 w +0 10 m +200 10 l +S +0.5 G +0 10 m +5 10 l +S +0.8 G +0.25 w +0 15 m +200 15 l +S +0.5 w +0 20 m +200 20 l +S +0.5 G +0 20 m +5 20 l +S +0.8 G +0.25 w +0 25 m +200 25 l +S +0.5 w +0 30 m +200 30 l +S +0.5 G +0 30 m +5 30 l +S +0.8 G +0.25 w +0 35 m +200 35 l +S +0.5 w +0 40 m +200 40 l +S +0.5 G +0 40 m +5 40 l +S +0.8 G +0.25 w +0 45 m +200 45 l +S +0.5 w +0 50 m +200 50 l +S +0.5 G +0 50 m +5 50 l +S +0.8 G +0.25 w +0 55 m +200 55 l +S +0.5 w +0 60 m +200 60 l +S +0.5 G +0 60 m +5 60 l +S +0.8 G +0.25 w +0 65 m +200 65 l +S +0.5 w +0 70 m +200 70 l +S +0.5 G +0 70 m +5 70 l +S +0.8 G +0.25 w +0 75 m +200 75 l +S +0.5 w +0 80 m +200 80 l +S +0.5 G +0 80 m +5 80 l +S +0.8 G +0.25 w +0 85 m +200 85 l +S +0.5 w +0 90 m +200 90 l +S +0.5 G +0 90 m +5 90 l +S +0.8 G +0.25 w +0 95 m +200 95 l +S +0.5 w +0 100 m +200 100 l +S +0.5 G +0 100 m +5 100 l +S +0.8 G +0.25 w +0 105 m +200 105 l +S +0.5 w +0 110 m +200 110 l +S +0.5 G +0 110 m +5 110 l +S +0.8 G +0.25 w +0 115 m +200 115 l +S +0.5 w +0 120 m +200 120 l +S +0.5 G +0 120 m +5 120 l +S +0.8 G +0.25 w +0 125 m +200 125 l +S +0.5 w +0 130 m +200 130 l +S +0.5 G +0 130 m +5 130 l +S +0.8 G +0.25 w +0 135 m +200 135 l +S +0.5 w +0 140 m +200 140 l +S +0.5 G +0 140 m +5 140 l +S +0.8 G +0.25 w +0 145 m +200 145 l +S +0.5 w +0 150 m +200 150 l +S +0.5 G +0 150 m +5 150 l +S +0.8 G +0.25 w +0 155 m +200 155 l +S +0.5 w +0 160 m +200 160 l +S +0.5 G +0 160 m +5 160 l +S +0.8 G +0.25 w +0 165 m +200 165 l +S +0.5 w +0 170 m +200 170 l +S +0.5 G +0 170 m +5 170 l +S +0.8 G +0.25 w +0 175 m +200 175 l +S +0.5 w +0 180 m +200 180 l +S +0.5 G +0 180 m +5 180 l +S +0.8 G +0.25 w +0 185 m +200 185 l +S +0.5 w +0 190 m +200 190 l +S +0.5 G +0 190 m +5 190 l +S +0.8 G +0.25 w +0 195 m +200 195 l +S +0.5 w +0 200 m +200 200 l +S +0.5 G +0 200 m +5 200 l +S +0.8 G +0.25 w +0 205 m +200 205 l +S +0.5 w +0 210 m +200 210 l +S +0.5 G +0 210 m +5 210 l +S +0.8 G +0.25 w +0 215 m +200 215 l +S +0.5 w +0 0 m +0 220 l +S +0.25 w +5 0 m +5 220 l +S +0.5 w +10 0 m +10 220 l +S +0.25 w +15 0 m +15 220 l +S +0.5 w +20 0 m +20 220 l +S +0.25 w +25 0 m +25 220 l +S +0.5 w +30 0 m +30 220 l +S +0.25 w +35 0 m +35 220 l +S +0.5 w +40 0 m +40 220 l +S +0.25 w +45 0 m +45 220 l +S +0.5 w +50 0 m +50 220 l +S +0.5 G +50 0 m +50 5 l +S +50 220 m +50 215 l +S +0.8 G +0.25 w +55 0 m +55 220 l +S +0.5 w +60 0 m +60 220 l +S +0.25 w +65 0 m +65 220 l +S +0.5 w +70 0 m +70 220 l +S +0.25 w +75 0 m +75 220 l +S +0.5 w +80 0 m +80 220 l +S +0.25 w +85 0 m +85 220 l +S +0.5 w +90 0 m +90 220 l +S +0.25 w +95 0 m +95 220 l +S +0.5 w +100 0 m +100 220 l +S +0.5 G +100 0 m +100 5 l +S +100 220 m +100 215 l +S +0.8 G +0.25 w +105 0 m +105 220 l +S +0.5 w +110 0 m +110 220 l +S +0.25 w +115 0 m +115 220 l +S +0.5 w +120 0 m +120 220 l +S +0.25 w +125 0 m +125 220 l +S +0.5 w +130 0 m +130 220 l +S +0.25 w +135 0 m +135 220 l +S +0.5 w +140 0 m +140 220 l +S +0.25 w +145 0 m +145 220 l +S +0.5 w +150 0 m +150 220 l +S +0.5 G +150 0 m +150 5 l +S +150 220 m +150 215 l +S +0.8 G +0.25 w +155 0 m +155 220 l +S +0.5 w +160 0 m +160 220 l +S +0.25 w +165 0 m +165 220 l +S +0.5 w +170 0 m +170 220 l +S +0.25 w +175 0 m +175 220 l +S +0.5 w +180 0 m +180 220 l +S +0.25 w +185 0 m +185 220 l +S +0.5 w +190 0 m +190 220 l +S +0.25 w +195 0 m +195 220 l +S +BT +5 8 Td +(10) Tj +ET +BT +5 18 Td +(20) Tj +ET +BT +5 28 Td +(30) Tj +ET +BT +5 38 Td +(40) Tj +ET +BT +5 48 Td +(50) Tj +ET +BT +5 58 Td +(60) Tj +ET +BT +5 68 Td +(70) Tj +ET +BT +5 78 Td +(80) Tj +ET +BT +5 88 Td +(90) Tj +ET +BT +5 98 Td +(100) Tj +ET +BT +5 108 Td +(110) Tj +ET +BT +5 118 Td +(120) Tj +ET +BT +5 128 Td +(130) Tj +ET +BT +5 138 Td +(140) Tj +ET +BT +5 148 Td +(150) Tj +ET +BT +5 158 Td +(160) Tj +ET +BT +5 168 Td +(170) Tj +ET +BT +5 178 Td +(180) Tj +ET +BT +5 188 Td +(190) Tj +ET +BT +5 198 Td +(200) Tj +ET +BT +5 208 Td +(210) Tj +ET +BT +50 5 Td +(50) Tj +ET +BT +50 210 Td +(50) Tj +ET +BT +100 5 Td +(100) Tj +ET +BT +100 210 Td +(100) Tj +ET +BT +150 5 Td +(150) Tj +ET +BT +150 210 Td +(150) Tj +ET +0 g +0 G +1 0 0 rg +100 100 m +100 180 l +100.00009 180 l +144.18284 179.99993 180 144.18273 180 100 c +180 65.34192 157.68321 34.62546 124.72143 23.9155 c +100 100 l +f +0 0 1 rg +100 100 m +124.72143 23.9155 l +124.72143 23.9155 l +82.70116 10.26224 37.56884 33.25821 23.91553 75.27846 c +100 100 l +f +0 1 0 rg +100 100 m +23.91553 75.27846 l +23.91553 75.27846 l +16.00205 99.63346 20.22633 126.30496 35.27849 147.02262 c +100 100 l +f +1 1 0 rg +100 100 m +35.27849 147.02262 l +35.27849 147.02262 l +50.33066 167.74028 74.39131 179.9999 99.99969 180 c +100 100 l +f +0 G +1 g +70 100 m +70 116.55999 83.44 130 100 130 c +116.55999 130 130 116.55999 130 100 c +130 83.44 116.55999 70 100 70 c +83.44 70 70 83.44 70 100 c +f + +endstream +endobj +6 0 obj +4244 +endobj +7 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +xref +0 8 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000184 00000 n +0000000360 00000 n +0000004658 00000 n +0000004678 00000 n +trailer +<< +/Root 1 0 R +/Info 3 0 R +/Size 8 +>> +startxref +4776 +%%EOF diff --git a/demo/arc_demo.tsl b/demo/arc_demo.tsl new file mode 100644 index 0000000..67b01b8 --- /dev/null +++ b/demo/arc_demo.tsl @@ -0,0 +1,190 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "arc_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); + +// add a new page object. +page := pdf.AddPage(); + +page.SetHeight(220); +page.SetWidth(200); + +// draw grid to the page +PrintGrid(pdf, page); + +// draw pie chart +// +// A: 45% Red +// B: 25% Blue +// C: 15% green +// D: other yellow + +// A +page.SetRGBFill(1.0, 0, 0); +page.MoveTo(100, 100); +page.LineTo(100, 180); +page.Arc(100, 100, 80, 0, 360 * 0.45); +pos := page.GetCurrentPos(); +page.LineTo(100, 100); +page.Fill(); + +// B +page.SetRGBFill(0, 0, 1.0); +page.MoveTo(100, 100); +page.LineTo(pos[0], pos[1]); +page.Arc(100, 100, 80, 360 * 0.45, 360 * 0.7); +pos := page.GetCurrentPos(); +page.LineTo(100, 100); +page.Fill(); + +// C +page.SetRGBFill(0, 1.0, 0); +page.MoveTo(100, 100); +page.LineTo(pos[0], pos[1]); +page.Arc(100, 100, 80, 360 * 0.7, 360 * 0.85); +pos := page.GetCurrentPos(); +page.LineTo(100, 100); +page.Fill(); + +// D +page.SetRGBFill(1.0, 1.0, 0); +page.MoveTo(100, 100); +page.LineTo(pos[0], pos[1]); +page.Arc(100, 100, 80, 360 * 0.85, 360); +pos := page.GetCurrentPos(); +page.LineTo(100, 100); +page.Fill(); + +// draw center circle +page.SetGrayStroke(0); +page.SetGrayFill(1); +page.Circle(100, 100, 30); +page.Fill(); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + + +Function PrintGrid(pdf, page) +Begin + height := page.GetHeight(); + width := page.GetWidth(); + font := pdf.GetFont("Helvetica", ""); + + page.SetFontAndSize(font, 5); + page.SetGrayFill(0.5); + page.SetGrayStroke(0.8); + + // Draw horizontal lines + y := 0; + while y < height do + begin + if y % 10 = 0 then + page.SetLineWidth(0.5); + else begin + wid := page.GetWidth(); + if wid <> 0.25 then page.SetLineWidth(0.25); + end + + page.MoveTo(0, y); + page.LineTo(width, y); + page.Stroke(); + + if y % 10 = 0 and y > 0 then + begin + page.SetGrayStroke(0.5); + + page.MoveTo(0, y); + page.LineTo(5, y); + page.Stroke(); + page.SetGrayStroke(0.8); + end + + y += 5; + end + + + // Draw vertical lines + x := 0; + while x < width do + begin + if x % 10 = 0 then + page.SetLineWidth(0.5); + else begin + wid := page.GetWidth(); + if wid <> 0.25 then page.SetLineWidth(0.25); + end + + page.MoveTo(x, 0); + page.LineTo(x, height); + page.Stroke(); + + if x % 50 = 0 and x > 0 then + begin + page.SetGrayStroke(0.5); + + page.MoveTo(x, 0); + page.LineTo(x, 5); + page.Stroke(); + + page.MoveTo(x, height); + page.LineTo(x, height - 5); + page.Stroke(); + + page.SetGrayStroke(0.8); + end + + x += 5; + end + + // Draw horizontal text + y := 0; + while y < height do + begin + if y % 10 = 0 and y > 0 then + begin + page.BeginText(); + page.MoveTextPos(5, y - 2); + page.ShowText(tostring(y)); + page.EndText(); + end + y += 5; + end + + + // Draw vertical text + x := 0; + while x < width do + begin + if x % 50 = 0 and x > 0 then + begin + buf := tostring(x); + page.BeginText(); + page.MoveTextPos(x, 5); + page.ShowText(buf); + page.EndText(); + + page.BeginText(); + page.MoveTextPos(x, height - 10); + page.ShowText(buf); + page.EndText(); + end + + x += 5; + end + + page.SetGrayFill(0); + page.SetGrayStroke(0); +End; diff --git a/demo/chinese_font_demo.pdf b/demo/chinese_font_demo.pdf new file mode 100644 index 0000000..175577e --- /dev/null +++ b/demo/chinese_font_demo.pdf @@ -0,0 +1,793 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +/PageMode /UseOutlines +/Outlines 28 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 30 0 R 36 0 R 41 0 R 46 0 R 51 0 R 56 0 R 61 0 R 66 0 R ] +/Count 8 +>> +endobj +3 0 obj +<< +/Producer (Haru Free PDF Library 2.4.4) +>> +endobj +4 0 obj +<< +/Type /Font +/BaseFont /SimSun +/Subtype /Type0 +/Encoding /GBK-EUC-H +/DescendantFonts [ 5 0 R ] +>> +endobj +5 0 obj +<< +/Type /Font +/Subtype /CIDFontType0 +/DW 1000 +/BaseFont /SimSun +/DW2 [ 880 -1000 ] +/W [ 668 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 696 [ 500 500 500 500 ] 814 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 7716 [ 500 ] ] +/FontDescriptor 6 0 R +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (GB1) +/Supplement 2 +>> +>> +endobj +6 0 obj +<< +/Type /FontDescriptor +/FontName /SimSun +/Ascent 859 +/Descent -140 +/CapHeight 683 +/MissingWidth 500 +/Flags 7 +/FontBBox [ 0 -140 996 855 ] +/ItalicAngle 0 +/StemV 78 +>> +endobj +7 0 obj +<< +/Type /Font +/BaseFont /SimSun,Bold +/Subtype /Type0 +/Encoding /GBK-EUC-H +/DescendantFonts [ 8 0 R ] +>> +endobj +8 0 obj +<< +/Type /Font +/Subtype /CIDFontType0 +/DW 1000 +/BaseFont /SimSun,Bold +/DW2 [ 880 -1000 ] +/W [ 668 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 696 [ 500 500 500 500 ] 814 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 7716 [ 500 ] ] +/FontDescriptor 9 0 R +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (GB1) +/Supplement 2 +>> +>> +endobj +9 0 obj +<< +/Type /FontDescriptor +/FontName /SimSun,Bold +/Ascent 859 +/Descent -140 +/CapHeight 683 +/MissingWidth 500 +/Flags 262151 +/FontBBox [ 0 -140 996 855 ] +/ItalicAngle 0 +/StemV 156 +>> +endobj +10 0 obj +<< +/Type /Font +/BaseFont /SimSun,Italic +/Subtype /Type0 +/Encoding /GBK-EUC-H +/DescendantFonts [ 11 0 R ] +>> +endobj +11 0 obj +<< +/Type /Font +/Subtype /CIDFontType0 +/DW 1000 +/BaseFont /SimSun,Italic +/DW2 [ 880 -1000 ] +/W [ 668 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 696 [ 500 500 500 500 ] 814 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 7716 [ 500 ] ] +/FontDescriptor 12 0 R +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (GB1) +/Supplement 2 +>> +>> +endobj +12 0 obj +<< +/Type /FontDescriptor +/FontName /SimSun,Italic +/Ascent 859 +/Descent -140 +/CapHeight 683 +/MissingWidth 500 +/Flags 71 +/FontBBox [ 0 -140 996 855 ] +/ItalicAngle -11 +/StemV 78 +>> +endobj +13 0 obj +<< +/Type /Font +/BaseFont /SimSun,BoldItalic +/Subtype /Type0 +/Encoding /GBK-EUC-H +/DescendantFonts [ 14 0 R ] +>> +endobj +14 0 obj +<< +/Type /Font +/Subtype /CIDFontType0 +/DW 1000 +/BaseFont /SimSun,BoldItalic +/DW2 [ 880 -1000 ] +/W [ 668 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 696 [ 500 500 500 500 ] 814 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 7716 [ 500 ] ] +/FontDescriptor 15 0 R +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (GB1) +/Supplement 2 +>> +>> +endobj +15 0 obj +<< +/Type /FontDescriptor +/FontName /SimSun,BoldItalic +/Ascent 859 +/Descent -140 +/CapHeight 683 +/MissingWidth 500 +/Flags 262215 +/FontBBox [ 0 -140 996 855 ] +/ItalicAngle -11 +/StemV 156 +>> +endobj +16 0 obj +<< +/Type /Font +/BaseFont /SimHei +/Subtype /Type0 +/Encoding /GBK-EUC-H +/DescendantFonts [ 17 0 R ] +>> +endobj +17 0 obj +<< +/Type /Font +/Subtype /CIDFontType0 +/DW 1000 +/BaseFont /SimHei +/DW2 [ 880 -1000 ] +/W [ 668 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 696 [ 500 500 500 500 ] 814 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 7716 [ 500 ] ] +/FontDescriptor 18 0 R +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (GB1) +/Supplement 2 +>> +>> +endobj +18 0 obj +<< +/Type /FontDescriptor +/FontName /SimHei +/Ascent 859 +/Descent -140 +/CapHeight 769 +/MissingWidth 500 +/Flags 5 +/FontBBox [ 0 -140 996 855 ] +/ItalicAngle 0 +/StemV 78 +>> +endobj +19 0 obj +<< +/Type /Font +/BaseFont /SimHei,Bold +/Subtype /Type0 +/Encoding /GBK-EUC-H +/DescendantFonts [ 20 0 R ] +>> +endobj +20 0 obj +<< +/Type /Font +/Subtype /CIDFontType0 +/DW 1000 +/BaseFont /SimHei,Bold +/DW2 [ 880 -1000 ] +/W [ 668 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 696 [ 500 500 500 500 ] 814 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 7716 [ 500 ] ] +/FontDescriptor 21 0 R +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (GB1) +/Supplement 2 +>> +>> +endobj +21 0 obj +<< +/Type /FontDescriptor +/FontName /SimHei,Bold +/Ascent 859 +/Descent -140 +/CapHeight 769 +/MissingWidth 500 +/Flags 262149 +/FontBBox [ 0 -140 996 855 ] +/ItalicAngle 0 +/StemV 156 +>> +endobj +22 0 obj +<< +/Type /Font +/BaseFont /SimHei,Italic +/Subtype /Type0 +/Encoding /GBK-EUC-H +/DescendantFonts [ 23 0 R ] +>> +endobj +23 0 obj +<< +/Type /Font +/Subtype /CIDFontType0 +/DW 1000 +/BaseFont /SimHei,Italic +/DW2 [ 880 -1000 ] +/W [ 668 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 696 [ 500 500 500 500 ] 814 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 7716 [ 500 ] ] +/FontDescriptor 24 0 R +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (GB1) +/Supplement 2 +>> +>> +endobj +24 0 obj +<< +/Type /FontDescriptor +/FontName /SimHei,Italic +/Ascent 859 +/Descent -140 +/CapHeight 769 +/MissingWidth 500 +/Flags 69 +/FontBBox [ 0 -140 996 855 ] +/ItalicAngle -11 +/StemV 78 +>> +endobj +25 0 obj +<< +/Type /Font +/BaseFont /SimHei,BoldItalic +/Subtype /Type0 +/Encoding /GBK-EUC-H +/DescendantFonts [ 26 0 R ] +>> +endobj +26 0 obj +<< +/Type /Font +/Subtype /CIDFontType0 +/DW 1000 +/BaseFont /SimHei,BoldItalic +/DW2 [ 880 -1000 ] +/W [ 668 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 696 [ 500 500 500 500 ] 814 [ 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 ] 7716 [ 500 ] ] +/FontDescriptor 27 0 R +/CIDSystemInfo << +/Registry (Adobe) +/Ordering (GB1) +/Supplement 2 +>> +>> +endobj +27 0 obj +<< +/Type /FontDescriptor +/FontName /SimHei,BoldItalic +/Ascent 859 +/Descent -140 +/CapHeight 769 +/MissingWidth 500 +/Flags 262213 +/FontBBox [ 0 -140 996 855 ] +/ItalicAngle -11 +/StemV 156 +>> +endobj +28 0 obj +<< +/Type /Outlines +/First 29 0 R +/Last 29 0 R +/Count 9 +>> +endobj +29 0 obj +<< +/Title (Chinese font demo) +/Type /Outlines +/Parent 28 0 R +/First 33 0 R +/Last 69 0 R +/Count 8 +>> +endobj +30 0 obj +<< +/Type /Page +/MediaBox [ 0 0 1630 210 ] +/Contents 31 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 35 0 R +/F2 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +31 0 obj +<< +/Length 32 0 R +/Filter [ /FlateDecode ] +>> +stream +xKn0NehCr^$ )-^zxf /' 9cji_IJ|>~<M/[#翤+GN L,pƝ^y Qd)R1! "!`Ƃv\pōEJD$- B ?v\j u7/}YſѻZYB X!֖coW9vihckߡt*8jJ s'ݹ,fS(,SO4} +_i;oc~??e~n= +YɏHPzmb-7X{+ڊ5Pe;PTՁ2<'{PA u;HV`u;DQC!((((((\0LV +l} }4 +ValZ*&e]+d60 60 60 646464}Kk*Rf +endstream +endobj +32 0 obj +512 +endobj +33 0 obj +<< +/Title (SimSun) +/Type /Outlines +/Parent 29 0 R +/Dest 34 0 R +/Next 39 0 R +>> +endobj +34 0 obj +[ 30 0 R /Fit ] +endobj +35 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +36 0 obj +<< +/Type /Page +/MediaBox [ 0 0 1630 210 ] +/Contents 37 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 35 0 R +/F2 7 0 R +>> +>> +/Parent 2 0 R +>> +endobj +37 0 obj +<< +/Length 38 0 R +/Filter [ /FlateDecode ] +>> +stream +x]0w-]I%RdB̌GC,> +endobj +40 0 obj +[ 36 0 R /Fit ] +endobj +41 0 obj +<< +/Type /Page +/MediaBox [ 0 0 1630 210 ] +/Contents 42 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 35 0 R +/F2 10 0 R +>> +>> +/Parent 2 0 R +>> +endobj +42 0 obj +<< +/Length 43 0 R +/Filter [ /FlateDecode ] +>> +stream +x͎0{"G=_BD}BZ 들C[/as .Ӿe>{z~}×__/?-͑ȑ#3 g.\qW$H$ ($,"Yi~FLH(`ņ\q@!1 e*A C˟ǎ+ڡB^/%/PBmm=_:v-)-tZp)8z^ٟW:i v\u|o-IO`|W$ +KpW0`z'N_O_n[Vbsqk 6=hom(W2t݁@~'A w:v`w:qCܑՑݑՑݑՑݑՑQQQQQQ +6Xa` +6\5@hP*XuULʺUj:l0l0l0l8l8l8U#C/&ɫXqɐ +endstream +endobj +43 0 obj +522 +endobj +44 0 obj +<< +/Title (SimSun,Italic) +/Type /Outlines +/Prev 39 0 R +/Parent 29 0 R +/Dest 45 0 R +/Next 49 0 R +>> +endobj +45 0 obj +[ 41 0 R /Fit ] +endobj +46 0 obj +<< +/Type /Page +/MediaBox [ 0 0 1630 210 ] +/Contents 47 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 35 0 R +/F2 13 0 R +>> +>> +/Parent 2 0 R +>> +endobj +47 0 obj +<< +/Length 48 0 R +/Filter [ /FlateDecode ] +>> +stream +x͎0{"G=_BDܾb Ovf>:9Nը[cߧvE,rCuyczؽo[9rb`dbf̅+7ʛE$K8͏  3ذ+n(R" $"&L^ 0d(rWcZPPH/}җuyUemʒZ +/{Z]-vy;O+g +m;ںRkz'Wl0~S$ +K` +74y +h;d~~|N YxOŽ6&Z +Ho 6Vkp(\w:terA w:v!w:qGVGvGVGvGVGvGVGvGQGqGQGqGQG*`aVf+p9T +Ce> +endobj +50 0 obj +[ 46 0 R /Fit ] +endobj +51 0 obj +<< +/Type /Page +/MediaBox [ 0 0 1630 210 ] +/Contents 52 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 35 0 R +/F2 16 0 R +>> +>> +/Parent 2 0 R +>> +endobj +52 0 obj +<< +/Length 53 0 R +/Filter [ /FlateDecode ] +>> +stream +xKn0NehCr^$ ) Gh hֽ~)3Yئ~ɔ?a#1_K-c8|zy}z<it^2IgY8sʍ;o!A$A!aR~;w-0bB@DBF+6I(S[@  +/~{C*급/}۷wſѻZFX!ֶѱ{9wiц[iʸCܳ#Th(%|οУ(Jt- 7&R[zmX%@ +PՁ@u;P(sMRA`u;XVC!u;D⎬쎬쎬쎬쎢⎢⎢2U +d0V +9U +Se> +endobj +55 0 obj +[ 51 0 R /Fit ] +endobj +56 0 obj +<< +/Type /Page +/MediaBox [ 0 0 1630 210 ] +/Contents 57 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 35 0 R +/F2 19 0 R +>> +>> +/Parent 2 0 R +>> +endobj +57 0 obj +<< +/Length 58 0 R +/Filter [ /FlateDecode ] +>> +stream +xKn0Ne y@P$t!-"A~$3^ئ~P?c-1̗SL"ea4G:훾sGN L,pƝ^y Qd)R1! "!`Ƃv\pōEJD$# B [/":j +5?Dz雗˧w.kkVB5V%۵jyeB_8-ThqZ s'=,f](,]w4e +i7c~??e~'o%[ŭ6&Z +Ho 6Vkp(\w:terA w:v!w:qGVGvGVGvGVGvGVGvGQGqGQGqGQG*`aVf+p9T +Ce> +endobj +60 0 obj +[ 56 0 R /Fit ] +endobj +61 0 obj +<< +/Type /Page +/MediaBox [ 0 0 1630 210 ] +/Contents 62 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 35 0 R +/F2 22 0 R +>> +>> +/Parent 2 0 R +>> +endobj +62 0 obj +<< +/Length 63 0 R +/Filter [ /FlateDecode ] +>> +stream +x͊0ڮ`)HM{޼@ +}NfFGC,s#GN L,pƝ^y Qd)R?1! "!`Ƃv\pōEJD$# B [/2;j +5?Dz雗˫w.kkVB5V%ۭjyeB_8-ThqZ s'=,f%QX7VQ\/SD))4ѽ|/Jt. 7&RGzmX%@ +PՁ@u;P(d?7u;HR`u;XQC!u;:;:;:;:;:;:;:0W+ l0[+fH͡U*[IYVJCV      ۾ts5yfp +endstream +endobj +63 0 obj +522 +endobj +64 0 obj +<< +/Title (SimHei,Italic) +/Type /Outlines +/Prev 59 0 R +/Parent 29 0 R +/Dest 65 0 R +/Next 69 0 R +>> +endobj +65 0 obj +[ 61 0 R /Fit ] +endobj +66 0 obj +<< +/Type /Page +/MediaBox [ 0 0 1630 210 ] +/Contents 67 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 35 0 R +/F2 25 0 R +>> +>> +/Parent 2 0 R +>> +endobj +67 0 obj +<< +/Length 68 0 R +/Filter [ /FlateDecode ] +>> +stream +x͎0{"G=_BDp޾bA* Ovf>:9Nը[cO?vE,C}y|5=lit޷~L׭91021p•w^xMDIB"H|G`Ą Vlq7 +)PB 2o~+ +vPcCy˺*~Gﲶkhe -TcP[[rqJ -ݮ\J;W'3{BWm_5pK=wғb6)X%xS0`4O42\?eLO YxOŽ6&Z +Ho 6Vkp(\w:terA w:v!w:qGVGvGVGvGVGvGVGvGQGqGQGqGQG*`aVf+p9T +Ce> +endobj +70 0 obj +[ 66 0 R /Fit ] +endobj +xref +0 71 +0000000000 65535 f +0000000015 00000 n +0000000104 00000 n +0000000213 00000 n +0000000274 00000 n +0000000389 00000 n +0000001126 00000 n +0000001309 00000 n +0000001429 00000 n +0000002171 00000 n +0000002365 00000 n +0000002489 00000 n +0000003235 00000 n +0000003429 00000 n +0000003557 00000 n +0000004307 00000 n +0000004510 00000 n +0000004627 00000 n +0000005366 00000 n +0000005550 00000 n +0000005672 00000 n +0000006416 00000 n +0000006611 00000 n +0000006735 00000 n +0000007481 00000 n +0000007675 00000 n +0000007803 00000 n +0000008553 00000 n +0000008756 00000 n +0000008830 00000 n +0000008946 00000 n +0000009136 00000 n +0000009729 00000 n +0000009749 00000 n +0000009844 00000 n +0000009876 00000 n +0000009975 00000 n +0000010165 00000 n +0000010763 00000 n +0000010783 00000 n +0000010896 00000 n +0000010928 00000 n +0000011119 00000 n +0000011722 00000 n +0000011742 00000 n +0000011857 00000 n +0000011889 00000 n +0000012080 00000 n +0000012687 00000 n +0000012707 00000 n +0000012826 00000 n +0000012858 00000 n +0000013049 00000 n +0000013641 00000 n +0000013661 00000 n +0000013769 00000 n +0000013801 00000 n +0000013992 00000 n +0000014590 00000 n +0000014610 00000 n +0000014723 00000 n +0000014755 00000 n +0000014946 00000 n +0000015549 00000 n +0000015569 00000 n +0000015684 00000 n +0000015716 00000 n +0000015907 00000 n +0000016514 00000 n +0000016534 00000 n +0000016640 00000 n +trailer +<< +/Root 1 0 R +/Info 3 0 R +/Size 71 +>> +startxref +16672 +%%EOF diff --git a/demo/chinese_font_demo.tsl b/demo/chinese_font_demo.tsl new file mode 100644 index 0000000..b35ffff --- /dev/null +++ b/demo/chinese_font_demo.tsl @@ -0,0 +1,121 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "chinese_font_demo.pdf"; +output_file := path + separator + output_file; + +zw := path + separator + "mbtext" + separator + "cp936.txt"; +readfile(rwraw(), alias, zw, 0, 1024*1024, samp_text); + +pdf := new PdfFile(); +PAGE_HEIGHT := 210; + +pdf.SetCompressionMode(TSPdfEnumerations.COMP_ALL); + +// declaration for using Japanese font, encoding. +pdf.UseCNSFonts(); +pdf.UseCNSEncodings(); + +detail_font := array(); +detail_font[0] := pdf.GetFont("SimSun", "GBK-EUC-H"); +detail_font[1] := pdf.GetFont("SimSun,Bold", "GBK-EUC-H"); +detail_font[2] := pdf.GetFont("SimSun,Italic", "GBK-EUC-H"); +detail_font[3] := pdf.GetFont("SimSun,BoldItalic", "GBK-EUC-H"); +detail_font[4] := pdf.GetFont("SimHei", "GBK-EUC-H"); +detail_font[5] := pdf.GetFont("SimHei,Bold", "GBK-EUC-H"); +detail_font[6] := pdf.GetFont("SimHei,Italic", "GBK-EUC-H"); +detail_font[7] := pdf.GetFont("SimHei,BoldItalic", "GBK-EUC-H"); + +// Set page mode to use outlines. +pdf.SetPageMode(TSPdfEnumerations.PAGE_MODE_USE_OUTLINE); + +// create outline root. +root := pdf.CreateOutline(nil, "Chinese font demo", nil); +root.SetOpened(true); + +for i := 0 to 7 do +begin + // add a new page object. + page := pdf.AddPage(); + + // create outline entry + outline := pdf.CreateOutline(root, detail_font[i].GetFontName(), nil); + dst := page.CreateDestination(); + outline.SetDestination(dst); + + title_font := pdf.GetFont("Helvetica", ""); + page.SetFontAndSize(title_font, 10); + + page.BeginText(); + + // move the position of the text to top of the page. + page.MoveTextPos(10, 190); + page.ShowText(detail_font[i].GetFontName()); + + page.SetFontAndSize(detail_font[i], 15); + page.MoveTextPos(10, -20); + page.ShowText("abcdefghijklmnopqrstuvwxyz"); + page.MoveTextPos(0, -20); + page.ShowText("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + page.MoveTextPos(0, -20); + page.ShowText("1234567890"); + page.MoveTextPos(0, -20); + + page.SetFontAndSize(detail_font[i], 10); + page.ShowText(samp_text); + page.MoveTextPos(0, -18); + + page.SetFontAndSize(detail_font[i], 16); + page.ShowText(samp_text); + page.MoveTextPos(0, -27); + + page.SetFontAndSize(detail_font[i], 23); + page.ShowText(samp_text); + page.MoveTextPos(0, -36); + + page.SetFontAndSize(detail_font[i], 30); + page.ShowText(samp_text); + + p := page.GetCurrentTextPos(); + + // finish to print text. + page.EndText(); + + page.SetLineWidth(0.5); + + x_pos := 20; + for j:=0 to length(samp_text)/2 do + begin + page.MoveTo(x_pos, p[1] - 10); + page.LineTo(x_pos, p[1] - 12); + page.Stroke(); + x_pos := x_pos + 30; + end + + page.SetWidth(p[0] + 20); + page.SetHeight(PAGE_HEIGHT); + + page.MoveTo(10, PAGE_HEIGHT - 25); + page.LineTo(p[0] + 10, PAGE_HEIGHT - 25); + page.Stroke(); + + page.MoveTo(10, PAGE_HEIGHT - 85); + page.LineTo(p[0] + 10, PAGE_HEIGHT - 85); + page.Stroke(); + + page.MoveTo(10, p[1] - 12); + page.LineTo(p[0] + 10, p[1] - 12); + page.Stroke(); +end + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; diff --git a/demo/encoding_list_demo.pdf b/demo/encoding_list_demo.pdf new file mode 100644 index 0000000..e5e6ac7 Binary files /dev/null and b/demo/encoding_list_demo.pdf differ diff --git a/demo/encoding_list_demo.tsl b/demo/encoding_list_demo.tsl new file mode 100644 index 0000000..ba06899 --- /dev/null +++ b/demo/encoding_list_demo.tsl @@ -0,0 +1,175 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "encoding_list_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); + +// set compression mode +pdf.SetCompressionMode(TSPdfEnumerations.COMP_ALL); + +// Set page mode to use outlines. +errcode := pdf.SetPageMode(TSPdfEnumerations.PAGE_MODE_USE_OUTLINE); + +// get default font +font := pdf.GetFont("Helvetica", ""); + +// load font object +afm_file := path + separator + "type1" + separator + "a010013l.afm"; +pfb_file := path + separator + "type1" + separator + "a010013l.pfb"; + +font_name := pdf.LoadType1FontFromFile(alias, afm_file, pfb_file); + +// create outline root. +root := pdf.CreateOutline(nil, "Encoding list", nil); +root.SetOpened(true); + +encodings := array( + "StandardEncoding", + "MacRomanEncoding", + "WinAnsiEncoding", + "ISO8859-2", + "ISO8859-3", + "ISO8859-4", + "ISO8859-5", + "ISO8859-9", + "ISO8859-10", + "ISO8859-13", + "ISO8859-14", + "ISO8859-15", + "ISO8859-16", + "CP1250", + "CP1251", + "CP1252", + "CP1254", + "CP1257", + "KOI8-R", + "Symbol-Set", + "ZapfDingbats-Set", + // "" +); + +page_width := 420; +page_height := 400; +cell_width := 20; +cell_height := 20; + +for i:=0 to length(encodings)-1 do +begin + page := pdf.AddPage(); + + page.SetWidth(page_width); + page.SetHeight(page_height); + + outline := pdf.CreateOutline(root, encodings[i], nil); + dst := page.CreateDestination(); + dst.SetXYZ(0, page_height, 1); + // pdf.Destination_SetFitB(dst); + outline.SetDestination(dst); + + page.SetFontAndSize(font, 15); + DrawGraph(page, page_width, page_height, cell_width, cell_height); + + page.BeginText(); + page.SetFontAndSize(font, 20); + page.MoveTextPos(40, page_height - 50); + page.ShowText(encodings[i]); + page.ShowText(" Encoding"); + page.EndText(); + + if encodings[i] = "Symbol-Set" then + font2 := pdf.GetFont("Symbol", ""); + else if encodings[i] = "ZapfDingbats-Set" then + font2 := pdf.GetFont("ZapfDingbats", ""); + else + font2 := pdf.GetFont(font_name, encodings[i]); + + page.SetFontAndSize(font2, 14); + DrawFonts(page, page_width, page_height, cell_width, cell_height); + +end + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function DrawGraph(page, page_width, page_height, cell_width, cell_height); +Begin + // Draw 16 X 15 cells + + // Draw vertical lines. + page.SetLineWidth(0.5); + + for i:=0 to 17 do + begin + x := i * cell_width + 40; + + page.MoveTo(x, page_height - 60); + page.LineTo(x, 40); + page.Stroke(); + + if (i > 0 and i <= 16) then + begin + page.BeginText(); + page.MoveTextPos(x + 5, page_height - 75); + buf := format("%x", i - 1); + page.ShowText(buf); + page.EndText(); + end + end + + // Draw horizontal lines. + for i:=0 to 15 do + begin + y := i * cell_height + 40; + + page.MoveTo(40, y); + page.LineTo(page_width - 40, y); + page.Stroke(); + + if (i < 14) then + begin + page.BeginText(); + page.MoveTextPos(45, y + 5); + buf := format("%x", 15 - i); + page.ShowText(buf); + page.EndText(); + end + end +End; + + +Function DrawFonts(page, page_width, page_height, cell_width, cell_height); +Begin + page.BeginText(); + + // Draw all character from 0x20 to 0xFF to the canvas. + for i:=1 to 16 do + begin + for j:=1 to 16 do + begin + y := page_height - 55 - ((i - 1) * cell_height); + x := j * cell_width + 50; + + n := (i - 1) * 16 + (j - 1); + if n > 256 then n := n % 256; + buf := chr(n); + if (n >= 32) then + begin + width := page.TextWidth(buf); + d := x - width / 2; + page.TextOut(d, y, buf); + end + end + end + page.EndText(); +End; diff --git a/demo/encryption_demo.pdf b/demo/encryption_demo.pdf new file mode 100644 index 0000000..523126c --- /dev/null +++ b/demo/encryption_demo.pdf @@ -0,0 +1,85 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 5 0 R ] +/Count 1 +>> +endobj +3 0 obj +<< +/Producer <16E0B3848BC417DE629855C8355DCEAF13E05D63527EAAA96D3EC5> +>> +endobj +4 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +5 0 obj +<< +/Type /Page +/MediaBox [ 0 0 708.66101 498.89801 ] +/Contents 6 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +6 0 obj +<< +/Length 7 0 R +>> +stream +EfyZ5Wꪶ·tzOa9p_ENNpTeZ,qX$ $㖔'6- +endstream +endobj +7 0 obj +79 +endobj +8 0 obj +<< +/O <94E809446EA9055A7940156EF5738F0163A1708027C4864F3411C83C0E76A901> +/U <89BC7D9826F5A9515FD3E09DA2E27889DF838F4DE01E53344F8B0A9860F9780A> +/Filter /Standard +/V 1 +/R 2 +/P -4 +>> +endobj +xref +0 9 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000211 00000 n +0000000309 00000 n +0000000497 00000 n +0000000630 00000 n +0000000648 00000 n +trailer +<< +/Encrypt 8 0 R +/Root 1 0 R +/Info 3 0 R +/ID [ <9DC8A0D206B4747B6D46A11400186F75> <9DC8A0D206B4747B6D46A11400186F75> ] +/Size 9 +>> +startxref +843 +%%EOF diff --git a/demo/encryption_demo.tsl b/demo/encryption_demo.tsl new file mode 100644 index 0000000..9586709 --- /dev/null +++ b/demo/encryption_demo.tsl @@ -0,0 +1,41 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "encryption_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); +// create default-font +font := pdf.GetFont("Helvetica", ""); + +// add a new page object. +page := pdf.AddPage(); + +page.SetSize(TSPdfEnumerations.PAGE_SIZE_B5, TSPdfEnumerations.PAGE_LANDSCAPE); + +text := "This is an encrypt document example."; +page.BeginText(); +page.SetFontAndSize(font, 20); +tw := page.TextWidth(text); +width := page.GetWidth(); +height := page.GetHeight(); +page.MoveTextPos((width - tw) / 2, (height - 20) / 2); +page.ShowText(text); +page.EndText(); + +owner_passwd := "owner"; +user_passwd := "user_passwd"; +pdf.SetPassword(owner_passwd, user_passwd); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + diff --git a/demo/font_demo.pdf b/demo/font_demo.pdf new file mode 100644 index 0000000..fdc8321 --- /dev/null +++ b/demo/font_demo.pdf @@ -0,0 +1,300 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 4 0 R ] +/Count 1 +>> +endobj +3 0 obj +<< +/Producer (Haru Free PDF Library 2.4.4) +>> +endobj +4 0 obj +<< +/Type /Page +/MediaBox [ 0 0 595 841 ] +/Contents 5 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 7 0 R +/F2 8 0 R +/F3 9 0 R +/F4 10 0 R +/F5 11 0 R +/F6 12 0 R +/F7 13 0 R +/F8 14 0 R +/F9 15 0 R +/F10 16 0 R +/F11 17 0 R +/F12 18 0 R +/F13 19 0 R +/F14 20 0 R +>> +>> +/Parent 2 0 R +>> +endobj +5 0 obj +<< +/Length 6 0 R +>> +stream +1 w +50 50 495 731 re +S +/F1 24 Tf +BT +238.14799 791 Td +(Font Demo) Tj +ET +BT +/F1 16 Tf +60 761 Td +(\074Standerd Type1 fonts samples\076) Tj +ET +BT +60 736 Td +/F1 9 Tf +(Courier) Tj +0 -18 Td +/F2 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Courier-Bold) Tj +0 -18 Td +/F3 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Courier-Oblique) Tj +0 -18 Td +/F4 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Courier-BoldOblique) Tj +0 -18 Td +/F5 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Helvetica) Tj +0 -18 Td +/F1 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Helvetica-Bold) Tj +0 -18 Td +/F6 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Helvetica-Oblique) Tj +0 -18 Td +/F7 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Helvetica-BoldOblique) Tj +0 -18 Td +/F8 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Times-Roman) Tj +0 -18 Td +/F9 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Times-Bold) Tj +0 -18 Td +/F10 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Times-Italic) Tj +0 -18 Td +/F11 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Times-BoldItalic) Tj +0 -18 Td +/F12 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(Symbol) Tj +0 -18 Td +/F13 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +/F1 9 Tf +(ZapfDingbats) Tj +0 -18 Td +/F14 20 Tf +(abcdefgABCDEFG12345!\043$\045&+-@?) Tj +0 -20 Td +ET + +endstream +endobj +6 0 obj +1503 +endobj +7 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +8 0 obj +<< +/Type /Font +/BaseFont /Courier +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +9 0 obj +<< +/Type /Font +/BaseFont /Courier-Bold +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +10 0 obj +<< +/Type /Font +/BaseFont /Courier-Oblique +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +11 0 obj +<< +/Type /Font +/BaseFont /Courier-BoldOblique +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +12 0 obj +<< +/Type /Font +/BaseFont /Helvetica-Bold +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +13 0 obj +<< +/Type /Font +/BaseFont /Helvetica-Oblique +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +14 0 obj +<< +/Type /Font +/BaseFont /Helvetica-BoldOblique +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +15 0 obj +<< +/Type /Font +/BaseFont /Times-Roman +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +16 0 obj +<< +/Type /Font +/BaseFont /Times-Bold +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +17 0 obj +<< +/Type /Font +/BaseFont /Times-Italic +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +18 0 obj +<< +/Type /Font +/BaseFont /Times-BoldItalic +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +19 0 obj +<< +/Type /Font +/BaseFont /Symbol +/Subtype /Type1 +>> +endobj +20 0 obj +<< +/Type /Font +/BaseFont /ZapfDingbats +/Subtype /Type1 +>> +endobj +xref +0 21 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000184 00000 n +0000000506 00000 n +0000002063 00000 n +0000002083 00000 n +0000002181 00000 n +0000002277 00000 n +0000002378 00000 n +0000002483 00000 n +0000002592 00000 n +0000002696 00000 n +0000002803 00000 n +0000002914 00000 n +0000003015 00000 n +0000003115 00000 n +0000003217 00000 n +0000003323 00000 n +0000003391 00000 n +trailer +<< +/Root 1 0 R +/Info 3 0 R +/Size 21 +>> +startxref +3465 +%%EOF diff --git a/demo/font_demo.tsl b/demo/font_demo.tsl new file mode 100644 index 0000000..15c7034 --- /dev/null +++ b/demo/font_demo.tsl @@ -0,0 +1,81 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +// tsl ./demo/font_demo.tsl --path=/mnt/d/code/tinysoft/Pdf-dev/demo --alias="" +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "font_demo.pdf"; +output_file := path + separator + output_file; + +page_title := "Font Demo"; +pdf := new PdfFile(); + +// 添加一个页面对象 +page := pdf.AddPage(); +height := page.GetHeight(); +width := page.GetWidth(); + +// 页面行数 +page.SetLineWidth(1); +page.Rectangle(50, 50, width - 100, height - 110); +page.Stroke(); + +// 页标题 +def_font := pdf.GetFont("Helvetica", ""); +page.SetFontAndSize(def_font, 24); +tw := page.TextWidth(page_title); +page.BeginText(); +page.TextOut((width - tw) / 2, height - 50, page_title); +page.EndText(); + +// 子标题 +page.BeginText(); +page.SetFontAndSize(def_font, 16); +page.TextOut(60, height - 80, ""); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(60, height - 105); + +font_list := array( + "Courier", + "Courier-Bold", + "Courier-Oblique", + "Courier-BoldOblique", + "Helvetica", + "Helvetica-Bold", + "Helvetica-Oblique", + "Helvetica-BoldOblique", + "Times-Roman", + "Times-Bold", + "Times-Italic", + "Times-BoldItalic", + "Symbol", + "ZapfDingbats", +); + +samp_text := "abcdefgABCDEFG12345!#$%&+-@?"; +for i:=0 to length(font_list)-1 do +begin + page.SetFontAndSize(def_font, 9); + page.ShowText(font_list[i]); + page.MoveTextPos(0, -18); + + font := pdf.GetFont(font_list[i], ""); + // echo "font = ", font_list[i], "\t err = ", err, "\t font = ", font, "\n"; + page.SetFontAndSize(font, 20); + page.ShowText(samp_text); + page.MoveTextPos(0, -20); +end + +page.EndText(); + +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + diff --git a/demo/grid_sheet_demo.pdf b/demo/grid_sheet_demo.pdf new file mode 100644 index 0000000..3ea38e0 --- /dev/null +++ b/demo/grid_sheet_demo.pdf @@ -0,0 +1,1520 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 4 0 R ] +/Count 1 +>> +endobj +3 0 obj +<< +/Producer (Haru Free PDF Library 2.4.4) +>> +endobj +4 0 obj +<< +/Type /Page +/MediaBox [ 0 0 400 600 ] +/Contents 5 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 7 0 R +>> +>> +/Parent 2 0 R +>> +endobj +5 0 obj +<< +/Length 6 0 R +>> +stream +/F1 5 Tf +0.5 g +0.8 G +0.5 w +0 0 m +400 0 l +S +0.25 w +0 5 m +400 5 l +S +0.5 w +0 10 m +400 10 l +S +0.5 G +0 10 m +5 10 l +S +0.8 G +0.25 w +0 15 m +400 15 l +S +0.5 w +0 20 m +400 20 l +S +0.5 G +0 20 m +5 20 l +S +0.8 G +0.25 w +0 25 m +400 25 l +S +0.5 w +0 30 m +400 30 l +S +0.5 G +0 30 m +5 30 l +S +0.8 G +0.25 w +0 35 m +400 35 l +S +0.5 w +0 40 m +400 40 l +S +0.5 G +0 40 m +5 40 l +S +0.8 G +0.25 w +0 45 m +400 45 l +S +0.5 w +0 50 m +400 50 l +S +0.5 G +0 50 m +5 50 l +S +0.8 G +0.25 w +0 55 m +400 55 l +S +0.5 w +0 60 m +400 60 l +S +0.5 G +0 60 m +5 60 l +S +0.8 G +0.25 w +0 65 m +400 65 l +S +0.5 w +0 70 m +400 70 l +S +0.5 G +0 70 m +5 70 l +S +0.8 G +0.25 w +0 75 m +400 75 l +S +0.5 w +0 80 m +400 80 l +S +0.5 G +0 80 m +5 80 l +S +0.8 G +0.25 w +0 85 m +400 85 l +S +0.5 w +0 90 m +400 90 l +S +0.5 G +0 90 m +5 90 l +S +0.8 G +0.25 w +0 95 m +400 95 l +S +0.5 w +0 100 m +400 100 l +S +0.5 G +0 100 m +5 100 l +S +0.8 G +0.25 w +0 105 m +400 105 l +S +0.5 w +0 110 m +400 110 l +S +0.5 G +0 110 m +5 110 l +S +0.8 G +0.25 w +0 115 m +400 115 l +S +0.5 w +0 120 m +400 120 l +S +0.5 G +0 120 m +5 120 l +S +0.8 G +0.25 w +0 125 m +400 125 l +S +0.5 w +0 130 m +400 130 l +S +0.5 G +0 130 m +5 130 l +S +0.8 G +0.25 w +0 135 m +400 135 l +S +0.5 w +0 140 m +400 140 l +S +0.5 G +0 140 m +5 140 l +S +0.8 G +0.25 w +0 145 m +400 145 l +S +0.5 w +0 150 m +400 150 l +S +0.5 G +0 150 m +5 150 l +S +0.8 G +0.25 w +0 155 m +400 155 l +S +0.5 w +0 160 m +400 160 l +S +0.5 G +0 160 m +5 160 l +S +0.8 G +0.25 w +0 165 m +400 165 l +S +0.5 w +0 170 m +400 170 l +S +0.5 G +0 170 m +5 170 l +S +0.8 G +0.25 w +0 175 m +400 175 l +S +0.5 w +0 180 m +400 180 l +S +0.5 G +0 180 m +5 180 l +S +0.8 G +0.25 w +0 185 m +400 185 l +S +0.5 w +0 190 m +400 190 l +S +0.5 G +0 190 m +5 190 l +S +0.8 G +0.25 w +0 195 m +400 195 l +S +0.5 w +0 200 m +400 200 l +S +0.5 G +0 200 m +5 200 l +S +0.8 G +0.25 w +0 205 m +400 205 l +S +0.5 w +0 210 m +400 210 l +S +0.5 G +0 210 m +5 210 l +S +0.8 G +0.25 w +0 215 m +400 215 l +S +0.5 w +0 220 m +400 220 l +S +0.5 G +0 220 m +5 220 l +S +0.8 G +0.25 w +0 225 m +400 225 l +S +0.5 w +0 230 m +400 230 l +S +0.5 G +0 230 m +5 230 l +S +0.8 G +0.25 w +0 235 m +400 235 l +S +0.5 w +0 240 m +400 240 l +S +0.5 G +0 240 m +5 240 l +S +0.8 G +0.25 w +0 245 m +400 245 l +S +0.5 w +0 250 m +400 250 l +S +0.5 G +0 250 m +5 250 l +S +0.8 G +0.25 w +0 255 m +400 255 l +S +0.5 w +0 260 m +400 260 l +S +0.5 G +0 260 m +5 260 l +S +0.8 G +0.25 w +0 265 m +400 265 l +S +0.5 w +0 270 m +400 270 l +S +0.5 G +0 270 m +5 270 l +S +0.8 G +0.25 w +0 275 m +400 275 l +S +0.5 w +0 280 m +400 280 l +S +0.5 G +0 280 m +5 280 l +S +0.8 G +0.25 w +0 285 m +400 285 l +S +0.5 w +0 290 m +400 290 l +S +0.5 G +0 290 m +5 290 l +S +0.8 G +0.25 w +0 295 m +400 295 l +S +0.5 w +0 300 m +400 300 l +S +0.5 G +0 300 m +5 300 l +S +0.8 G +0.25 w +0 305 m +400 305 l +S +0.5 w +0 310 m +400 310 l +S +0.5 G +0 310 m +5 310 l +S +0.8 G +0.25 w +0 315 m +400 315 l +S +0.5 w +0 320 m +400 320 l +S +0.5 G +0 320 m +5 320 l +S +0.8 G +0.25 w +0 325 m +400 325 l +S +0.5 w +0 330 m +400 330 l +S +0.5 G +0 330 m +5 330 l +S +0.8 G +0.25 w +0 335 m +400 335 l +S +0.5 w +0 340 m +400 340 l +S +0.5 G +0 340 m +5 340 l +S +0.8 G +0.25 w +0 345 m +400 345 l +S +0.5 w +0 350 m +400 350 l +S +0.5 G +0 350 m +5 350 l +S +0.8 G +0.25 w +0 355 m +400 355 l +S +0.5 w +0 360 m +400 360 l +S +0.5 G +0 360 m +5 360 l +S +0.8 G +0.25 w +0 365 m +400 365 l +S +0.5 w +0 370 m +400 370 l +S +0.5 G +0 370 m +5 370 l +S +0.8 G +0.25 w +0 375 m +400 375 l +S +0.5 w +0 380 m +400 380 l +S +0.5 G +0 380 m +5 380 l +S +0.8 G +0.25 w +0 385 m +400 385 l +S +0.5 w +0 390 m +400 390 l +S +0.5 G +0 390 m +5 390 l +S +0.8 G +0.25 w +0 395 m +400 395 l +S +0.5 w +0 400 m +400 400 l +S +0.5 G +0 400 m +5 400 l +S +0.8 G +0.25 w +0 405 m +400 405 l +S +0.5 w +0 410 m +400 410 l +S +0.5 G +0 410 m +5 410 l +S +0.8 G +0.25 w +0 415 m +400 415 l +S +0.5 w +0 420 m +400 420 l +S +0.5 G +0 420 m +5 420 l +S +0.8 G +0.25 w +0 425 m +400 425 l +S +0.5 w +0 430 m +400 430 l +S +0.5 G +0 430 m +5 430 l +S +0.8 G +0.25 w +0 435 m +400 435 l +S +0.5 w +0 440 m +400 440 l +S +0.5 G +0 440 m +5 440 l +S +0.8 G +0.25 w +0 445 m +400 445 l +S +0.5 w +0 450 m +400 450 l +S +0.5 G +0 450 m +5 450 l +S +0.8 G +0.25 w +0 455 m +400 455 l +S +0.5 w +0 460 m +400 460 l +S +0.5 G +0 460 m +5 460 l +S +0.8 G +0.25 w +0 465 m +400 465 l +S +0.5 w +0 470 m +400 470 l +S +0.5 G +0 470 m +5 470 l +S +0.8 G +0.25 w +0 475 m +400 475 l +S +0.5 w +0 480 m +400 480 l +S +0.5 G +0 480 m +5 480 l +S +0.8 G +0.25 w +0 485 m +400 485 l +S +0.5 w +0 490 m +400 490 l +S +0.5 G +0 490 m +5 490 l +S +0.8 G +0.25 w +0 495 m +400 495 l +S +0.5 w +0 500 m +400 500 l +S +0.5 G +0 500 m +5 500 l +S +0.8 G +0.25 w +0 505 m +400 505 l +S +0.5 w +0 510 m +400 510 l +S +0.5 G +0 510 m +5 510 l +S +0.8 G +0.25 w +0 515 m +400 515 l +S +0.5 w +0 520 m +400 520 l +S +0.5 G +0 520 m +5 520 l +S +0.8 G +0.25 w +0 525 m +400 525 l +S +0.5 w +0 530 m +400 530 l +S +0.5 G +0 530 m +5 530 l +S +0.8 G +0.25 w +0 535 m +400 535 l +S +0.5 w +0 540 m +400 540 l +S +0.5 G +0 540 m +5 540 l +S +0.8 G +0.25 w +0 545 m +400 545 l +S +0.5 w +0 550 m +400 550 l +S +0.5 G +0 550 m +5 550 l +S +0.8 G +0.25 w +0 555 m +400 555 l +S +0.5 w +0 560 m +400 560 l +S +0.5 G +0 560 m +5 560 l +S +0.8 G +0.25 w +0 565 m +400 565 l +S +0.5 w +0 570 m +400 570 l +S +0.5 G +0 570 m +5 570 l +S +0.8 G +0.25 w +0 575 m +400 575 l +S +0.5 w +0 580 m +400 580 l +S +0.5 G +0 580 m +5 580 l +S +0.8 G +0.25 w +0 585 m +400 585 l +S +0.5 w +0 590 m +400 590 l +S +0.5 G +0 590 m +5 590 l +S +0.8 G +0.25 w +0 595 m +400 595 l +S +0.5 w +0 0 m +0 600 l +S +0.25 w +5 0 m +5 600 l +S +0.5 w +10 0 m +10 600 l +S +0.25 w +15 0 m +15 600 l +S +0.5 w +20 0 m +20 600 l +S +0.25 w +25 0 m +25 600 l +S +0.5 w +30 0 m +30 600 l +S +0.25 w +35 0 m +35 600 l +S +0.5 w +40 0 m +40 600 l +S +0.25 w +45 0 m +45 600 l +S +0.5 w +50 0 m +50 600 l +S +0.5 G +50 0 m +50 5 l +S +50 600 m +50 595 l +S +0.8 G +0.25 w +55 0 m +55 600 l +S +0.5 w +60 0 m +60 600 l +S +0.25 w +65 0 m +65 600 l +S +0.5 w +70 0 m +70 600 l +S +0.25 w +75 0 m +75 600 l +S +0.5 w +80 0 m +80 600 l +S +0.25 w +85 0 m +85 600 l +S +0.5 w +90 0 m +90 600 l +S +0.25 w +95 0 m +95 600 l +S +0.5 w +100 0 m +100 600 l +S +0.5 G +100 0 m +100 5 l +S +100 600 m +100 595 l +S +0.8 G +0.25 w +105 0 m +105 600 l +S +0.5 w +110 0 m +110 600 l +S +0.25 w +115 0 m +115 600 l +S +0.5 w +120 0 m +120 600 l +S +0.25 w +125 0 m +125 600 l +S +0.5 w +130 0 m +130 600 l +S +0.25 w +135 0 m +135 600 l +S +0.5 w +140 0 m +140 600 l +S +0.25 w +145 0 m +145 600 l +S +0.5 w +150 0 m +150 600 l +S +0.5 G +150 0 m +150 5 l +S +150 600 m +150 595 l +S +0.8 G +0.25 w +155 0 m +155 600 l +S +0.5 w +160 0 m +160 600 l +S +0.25 w +165 0 m +165 600 l +S +0.5 w +170 0 m +170 600 l +S +0.25 w +175 0 m +175 600 l +S +0.5 w +180 0 m +180 600 l +S +0.25 w +185 0 m +185 600 l +S +0.5 w +190 0 m +190 600 l +S +0.25 w +195 0 m +195 600 l +S +0.5 w +200 0 m +200 600 l +S +0.5 G +200 0 m +200 5 l +S +200 600 m +200 595 l +S +0.8 G +0.25 w +205 0 m +205 600 l +S +0.5 w +210 0 m +210 600 l +S +0.25 w +215 0 m +215 600 l +S +0.5 w +220 0 m +220 600 l +S +0.25 w +225 0 m +225 600 l +S +0.5 w +230 0 m +230 600 l +S +0.25 w +235 0 m +235 600 l +S +0.5 w +240 0 m +240 600 l +S +0.25 w +245 0 m +245 600 l +S +0.5 w +250 0 m +250 600 l +S +0.5 G +250 0 m +250 5 l +S +250 600 m +250 595 l +S +0.8 G +0.25 w +255 0 m +255 600 l +S +0.5 w +260 0 m +260 600 l +S +0.25 w +265 0 m +265 600 l +S +0.5 w +270 0 m +270 600 l +S +0.25 w +275 0 m +275 600 l +S +0.5 w +280 0 m +280 600 l +S +0.25 w +285 0 m +285 600 l +S +0.5 w +290 0 m +290 600 l +S +0.25 w +295 0 m +295 600 l +S +0.5 w +300 0 m +300 600 l +S +0.5 G +300 0 m +300 5 l +S +300 600 m +300 595 l +S +0.8 G +0.25 w +305 0 m +305 600 l +S +0.5 w +310 0 m +310 600 l +S +0.25 w +315 0 m +315 600 l +S +0.5 w +320 0 m +320 600 l +S +0.25 w +325 0 m +325 600 l +S +0.5 w +330 0 m +330 600 l +S +0.25 w +335 0 m +335 600 l +S +0.5 w +340 0 m +340 600 l +S +0.25 w +345 0 m +345 600 l +S +0.5 w +350 0 m +350 600 l +S +0.5 G +350 0 m +350 5 l +S +350 600 m +350 595 l +S +0.8 G +0.25 w +355 0 m +355 600 l +S +0.5 w +360 0 m +360 600 l +S +0.25 w +365 0 m +365 600 l +S +0.5 w +370 0 m +370 600 l +S +0.25 w +375 0 m +375 600 l +S +0.5 w +380 0 m +380 600 l +S +0.25 w +385 0 m +385 600 l +S +0.5 w +390 0 m +390 600 l +S +0.25 w +395 0 m +395 600 l +S +BT +5 8 Td +(10) Tj +ET +BT +5 18 Td +(20) Tj +ET +BT +5 28 Td +(30) Tj +ET +BT +5 38 Td +(40) Tj +ET +BT +5 48 Td +(50) Tj +ET +BT +5 58 Td +(60) Tj +ET +BT +5 68 Td +(70) Tj +ET +BT +5 78 Td +(80) Tj +ET +BT +5 88 Td +(90) Tj +ET +BT +5 98 Td +(100) Tj +ET +BT +5 108 Td +(110) Tj +ET +BT +5 118 Td +(120) Tj +ET +BT +5 128 Td +(130) Tj +ET +BT +5 138 Td +(140) Tj +ET +BT +5 148 Td +(150) Tj +ET +BT +5 158 Td +(160) Tj +ET +BT +5 168 Td +(170) Tj +ET +BT +5 178 Td +(180) Tj +ET +BT +5 188 Td +(190) Tj +ET +BT +5 198 Td +(200) Tj +ET +BT +5 208 Td +(210) Tj +ET +BT +5 218 Td +(220) Tj +ET +BT +5 228 Td +(230) Tj +ET +BT +5 238 Td +(240) Tj +ET +BT +5 248 Td +(250) Tj +ET +BT +5 258 Td +(260) Tj +ET +BT +5 268 Td +(270) Tj +ET +BT +5 278 Td +(280) Tj +ET +BT +5 288 Td +(290) Tj +ET +BT +5 298 Td +(300) Tj +ET +BT +5 308 Td +(310) Tj +ET +BT +5 318 Td +(320) Tj +ET +BT +5 328 Td +(330) Tj +ET +BT +5 338 Td +(340) Tj +ET +BT +5 348 Td +(350) Tj +ET +BT +5 358 Td +(360) Tj +ET +BT +5 368 Td +(370) Tj +ET +BT +5 378 Td +(380) Tj +ET +BT +5 388 Td +(390) Tj +ET +BT +5 398 Td +(400) Tj +ET +BT +5 408 Td +(410) Tj +ET +BT +5 418 Td +(420) Tj +ET +BT +5 428 Td +(430) Tj +ET +BT +5 438 Td +(440) Tj +ET +BT +5 448 Td +(450) Tj +ET +BT +5 458 Td +(460) Tj +ET +BT +5 468 Td +(470) Tj +ET +BT +5 478 Td +(480) Tj +ET +BT +5 488 Td +(490) Tj +ET +BT +5 498 Td +(500) Tj +ET +BT +5 508 Td +(510) Tj +ET +BT +5 518 Td +(520) Tj +ET +BT +5 528 Td +(530) Tj +ET +BT +5 538 Td +(540) Tj +ET +BT +5 548 Td +(550) Tj +ET +BT +5 558 Td +(560) Tj +ET +BT +5 568 Td +(570) Tj +ET +BT +5 578 Td +(580) Tj +ET +BT +5 588 Td +(590) Tj +ET +BT +50 5 Td +(50) Tj +ET +BT +50 590 Td +(50) Tj +ET +BT +100 5 Td +(100) Tj +ET +BT +100 590 Td +(100) Tj +ET +BT +150 5 Td +(150) Tj +ET +BT +150 590 Td +(150) Tj +ET +BT +200 5 Td +(200) Tj +ET +BT +200 590 Td +(200) Tj +ET +BT +250 5 Td +(250) Tj +ET +BT +250 590 Td +(250) Tj +ET +BT +300 5 Td +(300) Tj +ET +BT +300 590 Td +(300) Tj +ET +BT +350 5 Td +(350) Tj +ET +BT +350 590 Td +(350) Tj +ET +0 g +0 G + +endstream +endobj +6 0 obj +9095 +endobj +7 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +xref +0 8 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000184 00000 n +0000000360 00000 n +0000009509 00000 n +0000009529 00000 n +trailer +<< +/Root 1 0 R +/Info 3 0 R +/Size 8 +>> +startxref +9627 +%%EOF diff --git a/demo/grid_sheet_demo.tsl b/demo/grid_sheet_demo.tsl new file mode 100644 index 0000000..7771ad9 --- /dev/null +++ b/demo/grid_sheet_demo.tsl @@ -0,0 +1,136 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "grid_sheet_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); +// add a new page object. +page := pdf.AddPage(); + +page.SetHeight(600); +page.SetWidth(400); + +PrintGrid(pdf, page); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function PrintGrid(pdf, page) +Begin + height := page.GetHeight(); + width := page.GetWidth(); + font := pdf.GetFont("Helvetica", ""); + + page.SetFontAndSize(font, 5); + page.SetGrayFill(0.5); + page.SetGrayStroke(0.8); + + // Draw horizontal lines + y := 0; + while y < height do + begin + if y % 10 = 0 then + page.SetLineWidth(0.5); + else begin + wid := page.GetWidth(); + if wid <> 0.25 then page.SetLineWidth(0.25); + end + + page.MoveTo(0, y); + page.LineTo(width, y); + page.Stroke(); + + if y % 10 = 0 and y > 0 then + begin + page.SetGrayStroke(0.5); + + page.MoveTo(0, y); + page.LineTo(5, y); + page.Stroke(); + page.SetGrayStroke(0.8); + end + + y += 5; + end + + + // Draw vertical lines + x := 0; + while x < width do + begin + if x % 10 = 0 then + page.SetLineWidth(0.5); + else + if page.GetWidth() <> 0.25 then page.SetLineWidth(0.25); + + page.MoveTo(x, 0); + page.LineTo(x, height); + page.Stroke(); + + if x % 50 = 0 and x > 0 then + begin + page.SetGrayStroke(0.5); + + page.MoveTo(x, 0); + page.LineTo(x, 5); + page.Stroke(); + + page.MoveTo(x, height); + page.LineTo(x, height - 5); + page.Stroke(); + + page.SetGrayStroke(0.8); + end + + x += 5; + end + + // Draw horizontal text + y := 0; + while y < height do + begin + if y % 10 = 0 and y > 0 then + begin + page.BeginText(); + page.MoveTextPos(5, y - 2); + page.ShowText(tostring(y)); + page.EndText(); + end + y += 5; + end + + + // Draw vertical text + x := 0; + while x < width do + begin + if x % 50 = 0 and x > 0 then + begin + buf := tostring(x); + page.BeginText(); + page.MoveTextPos(x, 5); + page.ShowText(buf); + page.EndText(); + + page.BeginText(); + page.MoveTextPos(x, height - 10); + page.ShowText(buf); + page.EndText(); + end + + x += 5; + end + + page.SetGrayFill(0); + page.SetGrayStroke(0); +End; diff --git a/demo/image_demo.pdf b/demo/image_demo.pdf new file mode 100644 index 0000000..5cf39f0 Binary files /dev/null and b/demo/image_demo.pdf differ diff --git a/demo/image_demo.tsl b/demo/image_demo.tsl new file mode 100644 index 0000000..855a4af --- /dev/null +++ b/demo/image_demo.tsl @@ -0,0 +1,173 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "image_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); + +pdf.SetCompressionMode(TSPdfEnumerations.COMP_ALL); + +// create default-font +font := pdf.GetFont("Helvetica", ""); + +// add a new page object. +page := pdf.AddPage(); + +page.SetWidth(550); +page.SetHeight(500); + +dst := page.CreateDestination(); + +dst.SetXYZ(0, page.GetHeight(), 1); +pdf.SetOpenAction(dst); + +page.BeginText(); +page.SetFontAndSize(font, 20); +page.MoveTextPos(220, page.GetHeight() - 70); +page.ShowText("Image Demo"); +page.EndText(); + +// load image file. +png_path := path + separator + "pngsuite" + separator; +p1 := png_path + "basn3p02.png"; +image := pdf.LoadPngImageFromFile("", p1); + +// image1 is masked by image2. +image1 := pdf.LoadPngImageFromFile("", p1); + +// image2 is a mask image. +p2 := png_path + "basn0g01.png"; +image2 := pdf.LoadPngImageFromFile("", p2); + +// image3 is a RGB-color image. we use this image for color-mask +p3 := png_path + "maskimage.png"; +image3 := pdf.LoadPngImageFromFile("", p3); + +iw := image.GetWidth(); +ih := image.GetHeight(); + +page.SetLineWidth(0.5); + +x := 100; +y := page.GetHeight() - 150; + +// Draw image to the canvas.(normal-mode with actual size.)// +page.DrawImage(image, x, y, iw, ih); + +ShowDescription(page, x, y, "Actual Size"); + +x += 150; + +// Scalling image(X direction) +page.DrawImage(image, x, y, iw * 1.5, ih); + +ShowDescription(page, x, y, "Scalling image(X direction)"); + +x += 150; + +// Scalling image(Y direction). +page.DrawImage(image, x, y, iw, ih * 1.5); +ShowDescription(page, x, y, "Scalling image(Y direction)"); + +x := 100; +y -= 120; + +// Skewing image. +angle1 := 10; +angle2 := 20; +rad1 := angle1 * 180 * 3.141592; +rad2 := angle2 * 180 * 3.141592; + +page.GSave(); + +page.Concat(iw, tan(rad1) * iw, tan(rad2) * ih, ih, x, y); + +page.ExecuteXObject(image); +page.GRestore(); + +ShowDescription(page, x, y, "Skewing image"); + +x += 150; + +// Rotating image +angle := 30; // rotation of 30 degrees. +rad := angle * 180 * 3.141592; // Calcurate the radian value. + +page.GSave(); + +page.Concat(iw * cos(rad), iw * sin(rad), ih * -sin(rad), ih * cos(rad), x, y); + +page.ExecuteXObject(image); +page.GRestore(); + +ShowDescription(page, x, y, "Rotating image"); + +x += 150; + +// draw masked image. + +// Set image2 to the mask image of image1 +image1.SetMaskImage(image2); + +page.SetRGBFill(0, 0, 0); +page.BeginText(); +page.MoveTextPos(x - 6, y + 14); +page.ShowText("MASKMASK"); +page.EndText(); + +page.DrawImage(image1, x - 3, y - 3, iw + 6, ih + 6); + +ShowDescription(page, x, y, "masked image"); + +x := 100; +y -= 120; + +// color mask. +page.SetRGBFill(0, 0, 0); +page.BeginText(); +page.MoveTextPos(x - 6, y + 14); +page.ShowText("MASKMASK"); +page.EndText(); + +image3.SetColorMask(0, 255, 0, 0, 0, 255); +page.DrawImage(image3, x, y, iw, ih); + +ShowDescription(page, x, y, "Color Mask"); + +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function ShowDescription(page, x, y, text) +Begin + page.MoveTo(x, y - 10); + page.LineTo(x, y + 10); + page.MoveTo(x - 10, y); + page.LineTo(x + 10, y); + page.Stroke(); + + page.SetFontAndSize(page.GetCurrentFont(), 8); + page.SetRGBFill(0, 0, 0); + + page.BeginText(); + + buf := format("(x=%d,y=%d)", x, y); + + page.MoveTextPos(x - page.TextWidth(buf) - 5, y - 10); + page.ShowText(buf); + page.EndText(); + + page.BeginText(); + page.MoveTextPos(x - 20, y - 25); + page.ShowText(text); + + page.EndText(); +End; diff --git a/demo/images/gray.jpg b/demo/images/gray.jpg new file mode 100644 index 0000000..09da027 Binary files /dev/null and b/demo/images/gray.jpg differ diff --git a/demo/images/rgb.jpg b/demo/images/rgb.jpg new file mode 100644 index 0000000..fb83e3e Binary files /dev/null and b/demo/images/rgb.jpg differ diff --git a/demo/jpeg_demo.pdf b/demo/jpeg_demo.pdf new file mode 100644 index 0000000..3be9b78 Binary files /dev/null and b/demo/jpeg_demo.pdf differ diff --git a/demo/jpeg_demo.tsl b/demo/jpeg_demo.tsl new file mode 100644 index 0000000..6396363 --- /dev/null +++ b/demo/jpeg_demo.tsl @@ -0,0 +1,66 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "jpeg_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); +pdf.SetCompressionMode(TSPdfEnumerations.COMP_ALL); + +// create default-font +font := pdf.GetFont("Helvetica", ""); + +// add a new page object. +page := pdf.AddPage(pdf); + +page.SetWidth(650); +page.SetHeight(500); + +height := page.GetHeight(); +dst := page.CreateDestination(); +dst.SetXYZ(0, height, 1); +pdf.SetOpenAction(dst); + +page.BeginText(); +page.SetFontAndSize(font, 20); +page.MoveTextPos(220, height - 70); +page.ShowText("Jpeg Demo"); +page.EndText(); + +page.SetFontAndSize(font, 12); + +jpeg_path := path + separator + "images" + separator; +DrawImage(pdf, alias, jpeg_path, "rgb.jpg", 70, height - 410, "24bit color image"); +DrawImage(pdf, alias, jpeg_path, "gray.jpg", 340, height - 410, "8bit grayscale image"); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function DrawImage(pdf, alias, path, filename, x, y, text); +Begin + filename2 := path + filename; + page := pdf.GetCurrentPage(); + image := pdf.LoadJpegImageFromFile(alias, filename2); + + // Draw image to the canvas + image_width := image.GetWidth(); + image_height := image.GetHeight(); + page.DrawImage(image, x, y, image_width, image_height); + + // Print the text + page.BeginText(); + page.SetTextLeading(16); + page.MoveTextPos(x, y); + page.ShowTextNextLine(filename); + page.ShowTextNextLine(text); + page.EndText(); +End; diff --git a/demo/line_demo.pdf b/demo/line_demo.pdf new file mode 100644 index 0000000..33028ca --- /dev/null +++ b/demo/line_demo.pdf @@ -0,0 +1,296 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 5 0 R ] +/Count 1 +>> +endobj +3 0 obj +<< +/Producer (Haru Free PDF Library 2.4.4) +>> +endobj +4 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +5 0 obj +<< +/Type /Page +/MediaBox [ 0 0 595 841 ] +/Contents 6 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +6 0 obj +<< +/Length 7 0 R +>> +stream +1 w +50 50 495 731 re +S +/F1 24 Tf +BT +239.47999 791 Td +(Line Demo) Tj +ET +/F1 10 Tf +0 w +BT +60 760 Td +(line width = 0) Tj +ET +60 755 m +260 755 l +S +1 w +BT +60 730 Td +(line width = 1.0) Tj +ET +60 725 m +260 725 l +S +2 w +BT +60 700 Td +(line width = 2.0) Tj +ET +60 695 m +260 695 l +S +1 w +[3 ] 1 d +BT +60 670 Td +(dash_ptn=\1333, phase=1 -- 2 on, 3 off, 3 on..) Tj +ET +60 665 m +260 665 l +S +[3 7 ] 2 d +BT +60 640 Td +(dash_ptn=\1337, 3, phase=2 -- 5 on, 3 off, 7 on..) Tj +ET +60 635 m +260 635 l +S +[8 7 2 7 ] 0 d +BT +60 610 Td +(dash_ptn=\1338, 7, 2, 7, phase=0) Tj +ET +60 605 m +260 605 l +S +[] 0 d +30 w +0 0.6 0 RG +0 J +BT +60 570 Td +(PDF_BUTT_END) Tj +ET +90 545 m +220 545 l +S +1 J +BT +60 505 Td +(PDF_ROUND_END) Tj +ET +90 480 m +220 480 l +S +2 J +BT +60 440 Td +(PDF_PROJECTING_SQUARE_END) Tj +ET +90 415 m +220 415 l +S +30 w +0 0 0.5 RG +0 j +120 300 m +150 340 l +200 300 l +S +BT +60 360 Td +(PDF_MITER_JOIN) Tj +ET +1 j +120 195 m +160 235 l +200 195 l +S +BT +60 255 Td +(PDF_ROUND_JOIN) Tj +ET +2 j +120 90 m +160 130 l +200 90 l +S +BT +60 150 Td +(PDF_BEVEL_JOIN) Tj +ET +2 w +0 0 0 RG +0.75 0 0 rg +BT +300 760 Td +(Stroke) Tj +ET +300 730 220 25 re +S +BT +300 710 Td +(Fill) Tj +ET +300 680 220 25 re +f +BT +300 660 Td +(Fill then Stroke) Tj +ET +300 630 220 25 re +B +q +BT +300 610 Td +(Clip Rectangle) Tj +ET +300 580 220 25 re +W +S +/F1 13 Tf +BT +290 600 Td +12 TL +(Clip Clip Clip Clip Clip Clip Clip Clip Clip Clip) Tj +(Clip Clip Clip Clip Clip Clip Clip Clip Clip Clip) ' +(Clip Clip Clip Clip Clip Clip Clip Clip Clip Clip) ' +ET +Q +0 0 0 rg +BT +300 540 Td +(CurveTo2\050x1, y1, x2. y2\051) Tj +ET +BT +335 435 Td +(Current point) Tj +100 90 Td +(\050x1, y1\051) Tj +50 -60 Td +(\050x2, y2\051) Tj +ET +[3 ] 0 d +0.5 w +430 530 m +480 470 l +S +[] 0 d +1.5 w +330 440 m +430 530 480 470 v +S +BT +300 390 Td +(CurveTo3\050x1, y1, x2. y2\051) Tj +ET +BT +335 285 Td +(Current point) Tj +100 90 Td +(\050x1, y1\051) Tj +50 -60 Td +(\050x2, y2\051) Tj +ET +[3 ] 0 d +0.5 w +330 290 m +430 380 l +S +[] 0 d +1.5 w +330 290 m +430 380 480 320 y +S +BT +300 240 Td +(CurveTo\050x1, y1, x2. y2, x3, y3\051) Tj +ET +BT +335 135 Td +(Current point) Tj +100 80 Td +(\050x1, y1\051) Tj +60 -30 Td +(\050x2, y2\051) Tj +-10 -100 Td +(\050x3, y3\051) Tj +ET +[3 ] 0 d +0.5 w +330 140 m +430 220 l +S +490 190 m +480 90 l +S +[] 0 d +1.5 w +330 140 m +430 220 490 190 480 90 c +S + +endstream +endobj +7 0 obj +2209 +endobj +xref +0 8 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000184 00000 n +0000000282 00000 n +0000000458 00000 n +0000002721 00000 n +trailer +<< +/Root 1 0 R +/Info 3 0 R +/Size 8 +>> +startxref +2741 +%%EOF diff --git a/demo/line_demo.tsl b/demo/line_demo.tsl new file mode 100644 index 0000000..e1cbbb7 --- /dev/null +++ b/demo/line_demo.tsl @@ -0,0 +1,290 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); + +output_file := "line_demo.pdf"; +output_file := path + separator + output_file; + +page_title := "Line Demo"; +pdf := new PdfFile(); + +// 默认字体 +font := pdf.GetFont("Helvetica", ""); + +// 添加页面 +page := pdf.AddPage(); + +// print the lines of the page +page.SetLineWidth(1); +width := page.GetWidth(); +height := page.GetHeight(); +page.Rectangle(50, 50, width - 100, height - 110); +page.Stroke(); + +// print the title of the page (with positioning center) +page.SetFontAndSize(font, 24); +tw := page.TextWidth(page_title); +page.BeginText(); +page.MoveTextPos((width - tw) / 2, height - 50); +page.ShowText(page_title); +page.EndText(); + +page.SetFontAndSize(font, 10); + +// Draw verious widths of lines +page.SetLineWidth(0); +DrawLine(page, 60, 770, "line width = 0"); + +page.SetLineWidth(1.0); +DrawLine(page, 60, 740, "line width = 1.0"); + +page.SetLineWidth(2.0); +DrawLine(page, 60, 710, "line width = 2.0"); + +// Line dash pattern +DASH_MODE1 := array(3); +DASH_MODE2 := array(3, 7); +DASH_MODE3 := array(8, 7, 2, 7); +page.SetLineWidth(1.0); +page.SetDash(DASH_MODE1, 1, 1); +DrawLine(page, 60, 680, "dash_ptn=[3, phase=1 -- 2 on, 3 off, 3 on.."); + +page.SetDash(DASH_MODE2, 2, 2); +DrawLine(page, 60, 650, "dash_ptn=[7, 3, phase=2 -- 5 on, 3 off, 7 on.."); + +page.SetDash(DASH_MODE3, 4, 0); +DrawLine(page, 60, 620, "dash_ptn=[8, 7, 2, 7, phase=0"); + +page.SetDash(array(), 0, 0); +page.SetLineWidth(30); +page.SetRGBStroke(0.0, 0.6, 0.0); + +// Line Cap Style +page.SetLineCap(TSPdfEnumerations.BUTT_END); +DrawLine2(page, 60, 570, "PDF_BUTT_END"); + +page.SetLineCap(TSPdfEnumerations.ROUND_END); +DrawLine2(page, 60, 505, "PDF_ROUND_END"); + +page.SetLineCap(TSPdfEnumerations.PROJECTING_SQUARE_END); +DrawLine2(page, 60, 440, "PDF_PROJECTING_SQUARE_END"); + +// Line Join Style +page.SetLineWidth(30); +page.SetRGBStroke(0.0, 0.0, 0.5); + +page.SetLineJoin(TSPdfEnumerations.MITER_JOIN); +page.MoveTo(120, 300); +page.LineTo(150, 340); +page.LineTo(200, 300); +page.Stroke(); +page.BeginText(); +page.MoveTextPos(60, 360); +page.ShowText("PDF_MITER_JOIN"); +page.EndText(); + +page.SetLineJoin(TSPdfEnumerations.ROUND_JOIN); +page.MoveTo(120, 195); +page.LineTo(160, 235); +page.LineTo(200, 195); +page.Stroke(); +page.BeginText(); +page.MoveTextPos(60, 255); +page.ShowText("PDF_ROUND_JOIN"); +page.EndText(); + +page.SetLineJoin(TSPdfEnumerations.BEVEL_JOIN); +page.MoveTo(120, 90); +page.LineTo(160, 130); +page.LineTo(200, 90); +page.Stroke(); +page.BeginText(); +page.MoveTextPos(60, 150); +page.ShowText("PDF_BEVEL_JOIN"); +page.EndText(); + +// Draw Rectangle +page.SetLineWidth(2); +page.SetRGBStroke(0, 0, 0); +page.SetRGBFill(0.75, 0, 0); + +DrawRect(page, 300, 770, "Stroke"); +page.Stroke(); +DrawRect(page, 300, 720, "Fill"); +page.Fill(); +DrawRect(page, 300, 670, "Fill then Stroke"); +page.FillStroke(); + +// Clip Rect +page.GSave(); +DrawRect(page, 300, 620, "Clip Rectangle"); +page.Clip(); +page.Stroke(); +page.SetFontAndSize(font, 13); + +page.BeginText(); +page.MoveTextPos(290, 600); +page.SetTextLeading(12); +page.ShowText("Clip Clip Clip Clip Clip Clip Clip Clip Clip Clip"); +page.ShowTextNextLine("Clip Clip Clip Clip Clip Clip Clip Clip Clip Clip"); +page.ShowTextNextLine("Clip Clip Clip Clip Clip Clip Clip Clip Clip Clip"); +page.EndText(); +page.GRestore(); + +// Curve Example(CurveTo2) +x := 330; +y := 440; +x1 := 430; +y1 := 530; +x2 := 480; +y2 := 470; +x3 := 480; +y3 := 90; + +page.SetRGBFill(0, 0, 0); + +page.BeginText(); +page.MoveTextPos(300, 540); +page.ShowText("CurveTo2(x1, y1, x2. y2)"); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(x + 5, y - 5); +page.ShowText("Current point"); +page.MoveTextPos(x1 - x, y1 - y); +page.ShowText("(x1, y1)"); +page.MoveTextPos(x2 - x1, y2 - y1); +page.ShowText("(x2, y2)"); +page.EndText(); + +page.SetDash(DASH_MODE1, 1, 0); + +page.SetLineWidth(0.5); +page.MoveTo(x1, y1); +page.LineTo(x2, y2); +page.Stroke(); + +page.SetDash(array(), 0, 0); + +page.SetLineWidth(1.5); + +page.MoveTo(x, y); +page.CurveTo2(x1, y1, x2, y2); +page.Stroke(); + +// Curve Example(CurveTo3) +y -= 150; +y1 -= 150; +y2 -= 150; + +page.BeginText(); +page.MoveTextPos(300, 390); +page.ShowText("CurveTo3(x1, y1, x2. y2)"); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(x + 5, y - 5); +page.ShowText("Current point"); +page.MoveTextPos(x1 - x, y1 - y); +page.ShowText("(x1, y1)"); +page.MoveTextPos(x2 - x1, y2 - y1); +page.ShowText("(x2, y2)"); +page.EndText(); + +page.SetDash(DASH_MODE1, 1, 0); + +page.SetLineWidth(0.5); +page.MoveTo(x, y); +page.LineTo(x1, y1); +page.Stroke(); + +page.SetDash(array(), 0, 0); + +page.SetLineWidth(1.5); +page.MoveTo(x, y); +page.CurveTo3(x1, y1, x2, y2); +page.Stroke(); + +// Curve Example(CurveTo) +y -= 150; +y1 -= 160; +y2 -= 130; +x2 += 10; + +page.BeginText(); +page.MoveTextPos(300, 240); +page.ShowText("CurveTo(x1, y1, x2. y2, x3, y3)"); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(x + 5, y - 5); +page.ShowText("Current point"); +page.MoveTextPos(x1 - x, y1 - y); +page.ShowText("(x1, y1)"); +page.MoveTextPos(x2 - x1, y2 - y1); +page.ShowText("(x2, y2)"); +page.MoveTextPos(x3 - x2, y3 - y2); +page.ShowText("(x3, y3)"); +page.EndText(); + +page.SetDash(DASH_MODE1, 1, 0); + +page.SetLineWidth(0.5); +page.MoveTo(x, y); +page.LineTo(x1, y1); +page.Stroke(); +page.MoveTo(x2, y2); +page.LineTo(x3, y3); +page.Stroke(); + +page.SetDash(array(), 0, 0); + +page.SetLineWidth(1.5); +page.MoveTo(x, y); +page.CurveTo(x1, y1, x2, y2, x3, y3); +page.Stroke(); + +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function DrawLine(page, x, y, text); +Begin + page.BeginText(); + page.MoveTextPos(x, y - 10); + page.ShowText(text); + page.EndText(); + + page.MoveTo(x, y - 15); + page.LineTo(x + 200, y - 15); + page.Stroke(); +End; + +Function DrawLine2(page, x, y, text); +Begin + page.BeginText(); + page.MoveTextPos(x, y); + page.ShowText(text); + page.EndText(); + + page.MoveTo(x + 30, y - 25); + page.LineTo(x + 160, y - 25); + page.Stroke(); +End; + +Function DrawRect(page, x, y, text); +Begin + page.BeginText(); + page.MoveTextPos(x, y - 10); + page.ShowText(text); + page.EndText(); + + page.Rectangle(x, y - 40, 220, 25); +End; diff --git a/demo/link_annotation_demo.pdf b/demo/link_annotation_demo.pdf new file mode 100644 index 0000000..726d557 --- /dev/null +++ b/demo/link_annotation_demo.pdf @@ -0,0 +1,449 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 5 0 R 8 0 R 11 0 R 14 0 R 17 0 R 20 0 R 23 0 R 26 0 R ] +/Count 8 +>> +endobj +3 0 obj +<< +/Producer (Haru Free PDF Library 2.4.4) +>> +endobj +4 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +5 0 obj +<< +/Type /Page +/MediaBox [ 0 0 300 220 ] +/Contents 6 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +/Annots [ 30 0 R 32 0 R 34 0 R 36 0 R 38 0 R 40 0 R 42 0 R 43 0 R ] +>> +endobj +6 0 obj +<< +/Length 7 0 R +>> +stream +BT +/F1 10 Tf +15 200 Td +(Link Annotation Demo) Tj +ET +BT +/F1 8 Tf +20 180 Td +23 TL +(Jump to Page1\050HilightMode=TSPdfEnumerations.ANNOT_NO_HIGHTLIGHT\051) Tj +T* +(Jump to Page2\050HilightMode=TSPdfEnumerations.ANNOT_INVERT_BOX\051) Tj +T* +(Jump to Page3\050HilightMode=TSPdfEnumerations.ANNOT_INVERT_BORDER\051) Tj +T* +(Jump to Page4\050HilightMode=TSPdfEnumerations.ANNOT_DOWN_APPEARANCE\051) Tj +T* +(Jump to Page5\050dash border\051) Tj +T* +(Jump to Page6\050no border\051) Tj +T* +(Jump to Page7\050bold border\051) Tj +T* +(URI\050) Tj +(http:\057\057sourceforge.net\057projects\057libharu) Tj +(\051) Tj +ET + +endstream +endobj +7 0 obj +599 +endobj +8 0 obj +<< +/Type /Page +/MediaBox [ 0 0 200 200 ] +/Contents 9 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +9 0 obj +<< +/Length 10 0 R +>> +stream +/F1 20 Tf +BT +50 150 Td +(Page:1) Tj +ET + +endstream +endobj +10 0 obj +38 +endobj +11 0 obj +<< +/Type /Page +/MediaBox [ 0 0 200 200 ] +/Contents 12 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +12 0 obj +<< +/Length 13 0 R +>> +stream +/F1 20 Tf +BT +50 150 Td +(Page:2) Tj +ET + +endstream +endobj +13 0 obj +38 +endobj +14 0 obj +<< +/Type /Page +/MediaBox [ 0 0 200 200 ] +/Contents 15 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +15 0 obj +<< +/Length 16 0 R +>> +stream +/F1 20 Tf +BT +50 150 Td +(Page:3) Tj +ET + +endstream +endobj +16 0 obj +38 +endobj +17 0 obj +<< +/Type /Page +/MediaBox [ 0 0 200 200 ] +/Contents 18 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +18 0 obj +<< +/Length 19 0 R +>> +stream +/F1 20 Tf +BT +50 150 Td +(Page:4) Tj +ET + +endstream +endobj +19 0 obj +38 +endobj +20 0 obj +<< +/Type /Page +/MediaBox [ 0 0 200 200 ] +/Contents 21 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +21 0 obj +<< +/Length 22 0 R +>> +stream +/F1 20 Tf +BT +50 150 Td +(Page:5) Tj +ET + +endstream +endobj +22 0 obj +38 +endobj +23 0 obj +<< +/Type /Page +/MediaBox [ 0 0 200 200 ] +/Contents 24 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +24 0 obj +<< +/Length 25 0 R +>> +stream +/F1 20 Tf +BT +50 150 Td +(Page:6) Tj +ET + +endstream +endobj +25 0 obj +38 +endobj +26 0 obj +<< +/Type /Page +/MediaBox [ 0 0 200 200 ] +/Contents 27 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +27 0 obj +<< +/Length 28 0 R +>> +stream +/F1 20 Tf +BT +50 150 Td +(Page:7) Tj +ET + +endstream +endobj +28 0 obj +38 +endobj +29 0 obj +[ 8 0 R /Fit ] +endobj +30 0 obj +<< +/Rect [ 16 176 301.19198 190 ] +/Type /Annot +/Subtype /Link +/Dest 29 0 R +/P 5 0 R +/H /N +>> +endobj +31 0 obj +[ 11 0 R /Fit ] +endobj +32 0 obj +<< +/Rect [ 16 153 286.97601 167 ] +/Type /Annot +/Subtype /Link +/Dest 31 0 R +/P 5 0 R +>> +endobj +33 0 obj +[ 14 0 R /Fit ] +endobj +34 0 obj +<< +/Rect [ 16 130 304.30398 144 ] +/Type /Annot +/Subtype /Link +/Dest 33 0 R +/P 5 0 R +/H /O +>> +endobj +35 0 obj +[ 17 0 R /Fit ] +endobj +36 0 obj +<< +/Rect [ 16 107 320.75201 121 ] +/Type /Annot +/Subtype /Link +/Dest 35 0 R +/P 5 0 R +/H /P +>> +endobj +37 0 obj +[ 20 0 R /Fit ] +endobj +38 0 obj +<< +/Rect [ 16 84 125.82399 98 ] +/Type /Annot +/Subtype /Link +/Dest 37 0 R +/P 5 0 R +/Border [ 0 0 1 [ 3 2 ] ] +>> +endobj +39 0 obj +[ 23 0 R /Fit ] +endobj +40 0 obj +<< +/Rect [ 16 61 117.37599 75 ] +/Type /Annot +/Subtype /Link +/Dest 39 0 R +/P 5 0 R +/Border [ 0 0 0 ] +>> +endobj +41 0 obj +[ 26 0 R /Fit ] +endobj +42 0 obj +<< +/Rect [ 16 38 123.59999 52 ] +/Type /Annot +/Subtype /Link +/Dest 41 0 R +/P 5 0 R +/Border [ 0 0 2 ] +>> +endobj +43 0 obj +<< +/Rect [ 16 15 175.16799 29 ] +/Type /Annot +/Subtype /Link +/A << +/Type /Action +/S /URI +/URI (http:\057\057sourceforge.net\057projects\057libharu) +>> +/P 5 0 R +>> +endobj +xref +0 44 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000171 00000 n +0000000232 00000 n +0000000330 00000 n +0000000574 00000 n +0000001227 00000 n +0000001246 00000 n +0000001422 00000 n +0000001515 00000 n +0000001534 00000 n +0000001712 00000 n +0000001806 00000 n +0000001825 00000 n +0000002003 00000 n +0000002097 00000 n +0000002116 00000 n +0000002294 00000 n +0000002388 00000 n +0000002407 00000 n +0000002585 00000 n +0000002679 00000 n +0000002698 00000 n +0000002876 00000 n +0000002970 00000 n +0000002989 00000 n +0000003167 00000 n +0000003261 00000 n +0000003280 00000 n +0000003311 00000 n +0000003420 00000 n +0000003452 00000 n +0000003555 00000 n +0000003587 00000 n +0000003696 00000 n +0000003728 00000 n +0000003837 00000 n +0000003869 00000 n +0000003996 00000 n +0000004028 00000 n +0000004147 00000 n +0000004179 00000 n +0000004298 00000 n +trailer +<< +/Root 1 0 R +/Info 3 0 R +/Size 44 +>> +startxref +4476 +%%EOF diff --git a/demo/link_annotation_demo.tsl b/demo/link_annotation_demo.tsl new file mode 100644 index 0000000..3384329 --- /dev/null +++ b/demo/link_annotation_demo.tsl @@ -0,0 +1,190 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "link_annotation_demo.pdf"; +output_file := path + separator + output_file; + + +pdf := new PdfFile(); +uri := "http://sourceforge.net/projects/libharu"; + +// create default-font +font := pdf.GetFont("Helvetica", ""); + +// create index page +page := pdf.AddPage(); +page.SetWidth(300); +page.SetHeight(220); + +// Add 7 pages to the document. +page_arr := array(); +for i:=0 to 6 do +begin + p := pdf.AddPage(); + page_arr[i] := p; + PrintPage(page_arr[i], font, i + 1); +end + +page.BeginText(); +page.SetFontAndSize(font, 10); +page.MoveTextPos(15, 200); +page.ShowText("Link Annotation Demo"); +page.EndText(); + +// Create Link-Annotation object on index page. +page.BeginText(); +page.SetFontAndSize(font, 8); +page.MoveTextPos(20, 180); +page.SetTextLeading(23); + +// page1 (ANNOT_NO_HIGHTLIGHT) +tp := page.GetCurrentTextPos(); + +page.ShowText("Jump to Page1(HilightMode=TSPdfEnumerations.ANNOT_NO_HIGHTLIGHT)"); +pos := page.GetCurrentTextPos(); +rect := array(tp[0] - 4, tp[1] - 4, pos[0] + 4, pos[1] + 10); + +page.MoveToNextLine(); + +dst := page_arr[0].CreateDestination(); +annot := page.CreateLinkAnnot(rect, dst); + +annot.LinkAnnotSetHighlightMode(TSPdfEnumerations.ANNOT_NO_HIGHTLIGHT); + + +// page2(pdf.ANNOT_INVERT_BOX) +tp := page.GetCurrentTextPos(); + +page.ShowText("Jump to Page2(HilightMode=TSPdfEnumerations.ANNOT_INVERT_BOX)"); +pos := page.GetCurrentTextPos(); +rect := array(tp[0] - 4, tp[1] - 4, pos[0] + 4, pos[1] + 10); + +page.MoveToNextLine(); + +dst := page_arr[1].CreateDestination(); + +annot := page.CreateLinkAnnot(rect, dst); + +annot.LinkAnnotSetHighlightMode(TSPdfEnumerations.ANNOT_INVERT_BOX); + + +// page3(pdf.ANNOT_INVERT_BORDER) +tp := page.GetCurrentTextPos(); + +page.ShowText("Jump to Page3(HilightMode=TSPdfEnumerations.ANNOT_INVERT_BORDER)"); +pos := page.GetCurrentTextPos(); +pos := page.GetCurrentTextPos(); +rect := array(tp[0] - 4, tp[1] - 4, pos[0] + 4, pos[1] + 10); + +page.MoveToNextLine(); + +dst := page_arr[2].CreateDestination(); + +annot := page.CreateLinkAnnot(rect, dst); + +annot.LinkAnnotSetHighlightMode(TSPdfEnumerations.ANNOT_INVERT_BORDER); + + +// page4(pdf.ANNOT_DOWN_APPEARANCE) +tp := page.GetCurrentTextPos(); + +page.ShowText("Jump to Page4(HilightMode=TSPdfEnumerations.ANNOT_DOWN_APPEARANCE)"); +pos := page.GetCurrentTextPos(); +rect := array(tp[0] - 4, tp[1] - 4, pos[0] + 4, pos[1] + 10); + +page.MoveToNextLine(); + +dst := page_arr[3].CreateDestination(); + +annot := page.CreateLinkAnnot(rect, dst); + +annot.LinkAnnotSetHighlightMode(TSPdfEnumerations.ANNOT_DOWN_APPEARANCE); + + +// page5(dash border) +tp := page.GetCurrentTextPos(); + +page.ShowText("Jump to Page5(dash border)"); +pos := page.GetCurrentTextPos(); +rect := array(tp[0] - 4, tp[1] - 4, pos[0] + 4, pos[1] + 10); + +page.MoveToNextLine(); + +dst := page_arr[4].CreateDestination(); + +annot := page.CreateLinkAnnot(rect, dst); + +annot.LinkAnnotSetBorderStyle(1, 3, 2); + + +// page6(no border) +tp := page.GetCurrentTextPos(); + +page.ShowText("Jump to Page6(no border)"); +pos := page.GetCurrentTextPos(); +rect := array(tp[0] - 4, tp[1] - 4, pos[0] + 4, pos[1] + 10); + +page.MoveToNextLine(); + +dst := page_arr[5].CreateDestination(); + +annot := page.CreateLinkAnnot(rect, dst); + +annot.LinkAnnotSetBorderStyle(0, 0, 0); + + +// page7(bold border) +tp := page.GetCurrentTextPos(); + +page.ShowText("Jump to Page7(bold border)"); +pos := page.GetCurrentTextPos(); +rect := array(tp[0] - 4, tp[1] - 4, pos[0] + 4, pos[1] + 10); + +page.MoveToNextLine(); + +dst := page_arr[6].CreateDestination(); + +annot := page.CreateLinkAnnot(rect, dst); + +annot.LinkAnnotSetBorderStyle(2, 0, 0); + + +// URI link +tp := page.GetCurrentTextPos(); + +page.ShowText("URI("); +page.ShowText(uri); +page.ShowText(")"); + +pos := page.GetCurrentTextPos(); +rect := array(tp[0] - 4, tp[1] - 4, pos[0] + 4, pos[1] + 10); + +page.CreateURILinkAnnot(rect, uri); + +page.EndText(); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function PrintPage(page, font, page_num); +Begin + page.SetWidth(200); + page.SetHeight(200); + + page.SetFontAndSize(font, 20); + page.BeginText(); + page.MoveTextPos(50, 150); + buf := format("Page:%d", page_num); + page.ShowText(buf); + page.EndText(); +End; + diff --git a/demo/mbtext/EUC_JP.txt b/demo/mbtext/EUC_JP.txt new file mode 100644 index 0000000..f509f9c --- /dev/null +++ b/demo/mbtext/EUC_JP.txt @@ -0,0 +1,10 @@ +ʤˤϡ +ʤϤ褦ޤ +ʤФϡ +ʤϤޤơɤ +ʤʤ +ʤ䤹ߤʤ +ʤ褦ʤ顣 +ʤǤ +ʤפ֤ꡣ +ʤ⤷ޤ diff --git a/demo/mbtext/cp932.txt b/demo/mbtext/cp932.txt new file mode 100644 index 0000000..0000f50 --- /dev/null +++ b/demo/mbtext/cp932.txt @@ -0,0 +1,10 @@ +iɂ́Bj +i͂悤܂Bj +i΂́Bj +i͂߂܂āAǂ낵Bj +iAȂBj +i₷݂ȂBj +i悤ȂBj +iCłBj +ivԂBj +iז܂Bj diff --git a/demo/mbtext/cp936.txt b/demo/mbtext/cp936.txt new file mode 100644 index 0000000..d27b7ab --- /dev/null +++ b/demo/mbtext/cp936.txt @@ -0,0 +1,10 @@ +ã +Ϻã +Ϻã +ãա +ˡ + +ټ + +þò +ˡ \ No newline at end of file diff --git a/demo/mbtext/euc.txt b/demo/mbtext/euc.txt new file mode 100644 index 0000000..4e0fd0c --- /dev/null +++ b/demo/mbtext/euc.txt @@ -0,0 +1 @@ +֤ʤ⤭˾Ӥ⤪褤Ǥ롣 \ No newline at end of file diff --git a/demo/mbtext/sjis.txt b/demo/mbtext/sjis.txt new file mode 100644 index 0000000..a76ec3b --- /dev/null +++ b/demo/mbtext/sjis.txt @@ -0,0 +1 @@ +A{ԂȂBɏGr悢łB \ No newline at end of file diff --git a/demo/outline_demo.pdf b/demo/outline_demo.pdf new file mode 100644 index 0000000..9ae037b --- /dev/null +++ b/demo/outline_demo.pdf @@ -0,0 +1,211 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +/PageMode /UseOutlines +/Outlines 14 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 5 0 R 8 0 R 11 0 R ] +/Count 3 +>> +endobj +3 0 obj +<< +/Producer (Haru Free PDF Library 2.4.4) +>> +endobj +4 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +5 0 obj +<< +/Type /Page +/MediaBox [ 0 0 800 800 ] +/Contents 6 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +6 0 obj +<< +/Length 7 0 R +>> +stream +/F1 30 Tf +/F1 20 Tf +BT +30 740 Td +(Page:1) Tj +ET + +endstream +endobj +7 0 obj +48 +endobj +8 0 obj +<< +/Type /Page +/MediaBox [ 0 0 800 800 ] +/Contents 9 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +9 0 obj +<< +/Length 10 0 R +>> +stream +/F1 30 Tf +/F1 20 Tf +BT +30 740 Td +(Page:2) Tj +ET + +endstream +endobj +10 0 obj +48 +endobj +11 0 obj +<< +/Type /Page +/MediaBox [ 0 0 800 800 ] +/Contents 12 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +12 0 obj +<< +/Length 13 0 R +>> +stream +/F1 30 Tf +/F1 20 Tf +BT +30 740 Td +(Page:3) Tj +ET + +endstream +endobj +13 0 obj +48 +endobj +14 0 obj +<< +/Type /Outlines +/First 15 0 R +/Last 15 0 R +/Count 4 +>> +endobj +15 0 obj +<< +/Title (OutlineRoot) +/Type /Outlines +/Parent 14 0 R +/First 16 0 R +/Last 18 0 R +/Count 3 +>> +endobj +16 0 obj +<< +/Title (page1) +/Type /Outlines +/Parent 15 0 R +/Next 17 0 R +/Dest 19 0 R +>> +endobj +17 0 obj +<< +/Title (page2) +/Type /Outlines +/Prev 16 0 R +/Parent 15 0 R +/Next 18 0 R +/Dest 20 0 R +>> +endobj +18 0 obj +<< +/Title +/Type /Outlines +/Prev 17 0 R +/Parent 15 0 R +/Dest 21 0 R +>> +endobj +19 0 obj +[ 5 0 R /XYZ 0 800 1 ] +endobj +20 0 obj +[ 8 0 R /XYZ 0 800 1 ] +endobj +21 0 obj +[ 11 0 R /XYZ 0 800 1 ] +endobj +xref +0 22 +0000000000 65535 f +0000000015 00000 n +0000000104 00000 n +0000000176 00000 n +0000000237 00000 n +0000000335 00000 n +0000000511 00000 n +0000000613 00000 n +0000000631 00000 n +0000000807 00000 n +0000000910 00000 n +0000000929 00000 n +0000001107 00000 n +0000001211 00000 n +0000001230 00000 n +0000001304 00000 n +0000001414 00000 n +0000001508 00000 n +0000001615 00000 n +0000001824 00000 n +0000001863 00000 n +0000001902 00000 n +trailer +<< +/Root 1 0 R +/Info 3 0 R +/Size 22 +>> +startxref +1942 +%%EOF diff --git a/demo/outline_demo.tsl b/demo/outline_demo.tsl new file mode 100644 index 0000000..f955f40 --- /dev/null +++ b/demo/outline_demo.tsl @@ -0,0 +1,83 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "outline_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); + + // create default-font +font := pdf.GetFont("Helvetica", ""); + +// Set page mode to use outlines. +pdf.SetPageMode(TSPdfEnumerations.PAGE_MODE_USE_OUTLINE); + +page_arr := array(); +// Add 3 pages to the document. +page := pdf.AddPage(); +page.SetFontAndSize(font, 30); +PrintPage(page, font, 1); +page_arr[0] := page; + +page := pdf.AddPage(); +page.SetFontAndSize(font, 30); +PrintPage(page, font, 2); +page_arr[1] := page; + +page := pdf.AddPage(); +page.SetFontAndSize(font, 30); +PrintPage(page, font, 3); +page_arr[2] := page; + +// create outline root. +root := pdf.CreateOutline(nil, "OutlineRoot", nil); +root.SetOpened(true); + +outline1 := pdf.CreateOutline(root, "page1", nil); +outline2 := pdf.CreateOutline(root, "page2", nil); + +// create outline with test which is ISO8859-2 encoding +outline3 := pdf.CreateOutline(root, "ISO8859-2 text سشصض×طظ", pdf.GetEncoder("ISO8859-2")); + +// create destination objects on each pages and link it to outline items. + +dst := page_arr[0].CreateDestination(); +height := page_arr[0].GetHeight(); +dst.SetXYZ(0, height, 1); +outline1.SetDestination(dst); + +dst := page_arr[1].CreateDestination(); +height := page_arr[1].GetHeight(); +dst.SetXYZ(0, height, 1); +outline2.SetDestination(dst); + +dst := page_arr[2].CreateDestination(); +height := page_arr[2].GetHeight(); +dst.SetXYZ(0, height, 1); +outline3.SetDestination(dst); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function PrintPage(page, font, page_num); +Begin + page.SetWidth(800); + page.SetHeight(800); + + page.SetFontAndSize(font, 20); + page.BeginText(); + page.MoveTextPos(30, 740); + buf := format("Page:%d", page_num); + page.ShowText(buf); + page.EndText(); +End; + diff --git a/demo/permission_demo.pdf b/demo/permission_demo.pdf new file mode 100644 index 0000000..eda9785 --- /dev/null +++ b/demo/permission_demo.pdf @@ -0,0 +1,86 @@ +%PDF-1.4 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 5 0 R ] +/Count 1 +>> +endobj +3 0 obj +<< +/Producer <3B31DBE5EDA2686B1704AC27DC644919F64AED9FC6B8A875483A5D> +>> +endobj +4 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +5 0 obj +<< +/Type /Page +/MediaBox [ 0 0 708.66101 498.89801 ] +/Contents 6 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +>> +endobj +6 0 obj +<< +/Length 7 0 R +>> +stream +O& nnsϯk%G~q/QaαzAW9="Czwa;(JgT$S7 +endstream +endobj +7 0 obj +83 +endobj +8 0 obj +<< +/O <566FA873EE33C797CD3B904FDADF814AFA34DF9A38F6ED41B984E2C6DA2AA6F5> +/U <4F1701F7CD1141344D5B4FDD31E86C6200000000000000000000000000000000> +/Filter /Standard +/V 2 +/R 3 +/Length 128 +/P 0 +>> +endobj +xref +0 9 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000211 00000 n +0000000309 00000 n +0000000497 00000 n +0000000634 00000 n +0000000652 00000 n +trailer +<< +/Encrypt 8 0 R +/Root 1 0 R +/Info 3 0 R +/ID [ <32F1568EF2DBA0E79ADC1FC9A8372131> <32F1568EF2DBA0E79ADC1FC9A8372131> ] +/Size 9 +>> +startxref +858 +%%EOF diff --git a/demo/permission_demo.tsl b/demo/permission_demo.tsl new file mode 100644 index 0000000..9ce2d92 --- /dev/null +++ b/demo/permission_demo.tsl @@ -0,0 +1,42 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "permission_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); + // create default-font +font := pdf.GetFont("Helvetica", ""); + +// add a new page object. +page := pdf.AddPage(); + +page.SetSize(TSPdfEnumerations.PAGE_SIZE_B5, TSPdfEnumerations.PAGE_LANDSCAPE); + +text := "User cannot print and copy this document."; +page.BeginText(); +page.SetFontAndSize(font, 20); +tw := page.TextWidth(text); +width := page.GetWidth(); +height := page.GetHeight(); +page.MoveTextPos((width - tw) / 2, (height - 20) / 2); +page.ShowText(text); +page.EndText(); + +owner_passwd := "owner"; +user_passwd := ""; +pdf.SetPassword(owner_passwd, user_passwd); +pdf.SetPermission(TSPdfEnumerations.ENABLE_READ); +pdf.SetEncryptionMode(TSPdfEnumerations.ENCRYPT_R3, 16); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; diff --git a/demo/png_demo.pdf b/demo/png_demo.pdf new file mode 100644 index 0000000..ef84568 Binary files /dev/null and b/demo/png_demo.pdf differ diff --git a/demo/png_demo.tsl b/demo/png_demo.tsl new file mode 100644 index 0000000..278daf2 --- /dev/null +++ b/demo/png_demo.tsl @@ -0,0 +1,82 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "png_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); +pdf.SetCompressionMode(TSPdfEnumerations.COMP_ALL); + +// create default-font +font := pdf.GetFont("Helvetica", ""); + +// add a new page object. +page := pdf.AddPage(); + +page.SetWidth(550); +page.SetHeight(650); + +height := page.GetHeight(); +dst := page.CreateDestination(); +dst.SetXYZ(0, height, 1); +errcode := pdf.SetOpenAction(dst); + +page.BeginText(); +page.SetFontAndSize(font, 20); +page.MoveTextPos(220, height - 70); +page.ShowText("Png Demo"); +page.EndText(); + +page.SetFontAndSize(font, 12); + +png_path := path + separator + "pngsuite" + separator; +DrawImage(pdf, alias, png_path, "basn0g01.png", 100, height - 150, "1bit grayscale."); +DrawImage(pdf, alias, png_path, "basn0g02.png", 200, height - 150, "2bit grayscale."); +DrawImage(pdf, alias, png_path, "basn0g04.png", 300, height - 150, "4bit grayscale."); +DrawImage(pdf, alias, png_path, "basn0g08.png", 400, height - 150, "8bit grayscale."); + +DrawImage(pdf, alias, png_path, "basn2c08.png", 100, height - 250, "8bit color."); +DrawImage(pdf, alias, png_path, "basn2c16.png", 200, height - 250, "16bit color."); + +DrawImage(pdf, alias, png_path, "basn3p01.png", 100, height - 350, "1bit pallet."); +DrawImage(pdf, alias, png_path, "basn3p02.png", 200, height - 350, "2bit pallet."); +DrawImage(pdf, alias, png_path, "basn3p04.png", 300, height - 350, "4bit pallet."); +DrawImage(pdf, alias, png_path, "basn3p08.png", 400, height - 350, "8bit pallet."); + +DrawImage(pdf, alias, png_path, "basn4a08.png", 100, height - 450, "8bit alpha."); +DrawImage(pdf, alias, png_path, "basn4a16.png", 200, height - 450, "16bit alpha."); + +DrawImage(pdf, alias, png_path, "basn6a08.png", 100, height - 550, "8bit alpha."); +DrawImage(pdf, alias, png_path, "basn6a16.png", 200, height - 550, "16bit alpha."); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function DrawImage(pdf, alias, png_path, filename, x, y, text); +Begin + filename2 := png_path + filename; + page := pdf.GetCurrentPage(); + image := pdf.LoadPngImageFromFile(alias, filename2); + + // Draw image to the canvas + image_width := image.GetWidth(); + image_height := image.GetHeight(); + page.DrawImage(image, x, y, image_width, image_height); + + // Print the text + page.BeginText(); + page.SetTextLeading(16); + page.MoveTextPos(x, y); + page.ShowTextNextLine(filename); + page.ShowTextNextLine(text); + page.EndText(); +End; diff --git a/demo/pngsuite/README b/demo/pngsuite/README new file mode 100644 index 0000000..714d12c --- /dev/null +++ b/demo/pngsuite/README @@ -0,0 +1,85 @@ + +pngsuite +-------- +(c) Willem van Schaik, 1999 + +Permission to use, copy, and distribute these images for any purpose and +without fee is hereby granted. + +These 15 images are part of the much larger PngSuite test-set of +images, available for developers of PNG supporting software. The +complete set, available at http:/www.schaik.com/pngsuite/, contains +a variety of images to test interlacing, gamma settings, ancillary +chunks, etc. + +The images in this directory represent the basic PNG color-types: +grayscale (1-16 bit deep), full color (8 or 16 bit), paletted +(1-8 bit) and grayscale or color images with alpha channel. You +can use them to test the proper functioning of PNG software. + + filename depth type + ------------ ------ -------------- + basn0g01.png 1-bit grayscale + basn0g02.png 2-bit grayscale + basn0g04.png 4-bit grayscale + basn0g08.png 8-bit grayscale + basn0g16.png 16-bit grayscale + basn2c08.png 8-bit truecolor + basn2c16.png 16-bit truecolor + basn3p01.png 1-bit paletted + basn3p02.png 2-bit paletted + basn3p04.png 4-bit paletted + basn3p08.png 8-bit paletted + basn4a08.png 8-bit gray with alpha + basn4a16.png 16-bit gray with alpha + basn6a08.png 8-bit RGBA + basn6a16.png 16-bit RGBA + +Here is the correct result of typing "pngtest -m *.png" in +this directory: + +Testing basn0g01.png: PASS (524 zero samples) + Filter 0 was used 32 times +Testing basn0g02.png: PASS (448 zero samples) + Filter 0 was used 32 times +Testing basn0g04.png: PASS (520 zero samples) + Filter 0 was used 32 times +Testing basn0g08.png: PASS (3 zero samples) + Filter 1 was used 9 times + Filter 4 was used 23 times +Testing basn0g16.png: PASS (1 zero samples) + Filter 1 was used 1 times + Filter 2 was used 31 times +Testing basn2c08.png: PASS (6 zero samples) + Filter 1 was used 5 times + Filter 4 was used 27 times +Testing basn2c16.png: PASS (592 zero samples) + Filter 1 was used 1 times + Filter 4 was used 31 times +Testing basn3p01.png: PASS (512 zero samples) + Filter 0 was used 32 times +Testing basn3p02.png: PASS (448 zero samples) + Filter 0 was used 32 times +Testing basn3p04.png: PASS (544 zero samples) + Filter 0 was used 32 times +Testing basn3p08.png: PASS (4 zero samples) + Filter 0 was used 32 times +Testing basn4a08.png: PASS (32 zero samples) + Filter 1 was used 1 times + Filter 4 was used 31 times +Testing basn4a16.png: PASS (64 zero samples) + Filter 0 was used 1 times + Filter 1 was used 2 times + Filter 2 was used 1 times + Filter 4 was used 28 times +Testing basn6a08.png: PASS (160 zero samples) + Filter 1 was used 1 times + Filter 4 was used 31 times +Testing basn6a16.png: PASS (1072 zero samples) + Filter 1 was used 4 times + Filter 4 was used 28 times +libpng passes test + +Willem van Schaik + +October 1999 diff --git a/demo/pngsuite/basn0g01.png b/demo/pngsuite/basn0g01.png new file mode 100644 index 0000000..1d72242 Binary files /dev/null and b/demo/pngsuite/basn0g01.png differ diff --git a/demo/pngsuite/basn0g02.png b/demo/pngsuite/basn0g02.png new file mode 100644 index 0000000..5083324 Binary files /dev/null and b/demo/pngsuite/basn0g02.png differ diff --git a/demo/pngsuite/basn0g04.png b/demo/pngsuite/basn0g04.png new file mode 100644 index 0000000..0bf3687 Binary files /dev/null and b/demo/pngsuite/basn0g04.png differ diff --git a/demo/pngsuite/basn0g08.png b/demo/pngsuite/basn0g08.png new file mode 100644 index 0000000..23c8237 Binary files /dev/null and b/demo/pngsuite/basn0g08.png differ diff --git a/demo/pngsuite/basn0g16.png b/demo/pngsuite/basn0g16.png new file mode 100644 index 0000000..e7c82f7 Binary files /dev/null and b/demo/pngsuite/basn0g16.png differ diff --git a/demo/pngsuite/basn2c08.png b/demo/pngsuite/basn2c08.png new file mode 100644 index 0000000..db5ad15 Binary files /dev/null and b/demo/pngsuite/basn2c08.png differ diff --git a/demo/pngsuite/basn2c16.png b/demo/pngsuite/basn2c16.png new file mode 100644 index 0000000..50c1cb9 Binary files /dev/null and b/demo/pngsuite/basn2c16.png differ diff --git a/demo/pngsuite/basn3p01.png b/demo/pngsuite/basn3p01.png new file mode 100644 index 0000000..b145c2b Binary files /dev/null and b/demo/pngsuite/basn3p01.png differ diff --git a/demo/pngsuite/basn3p02.png b/demo/pngsuite/basn3p02.png new file mode 100644 index 0000000..8985b3d Binary files /dev/null and b/demo/pngsuite/basn3p02.png differ diff --git a/demo/pngsuite/basn3p04.png b/demo/pngsuite/basn3p04.png new file mode 100644 index 0000000..0fbf9e8 Binary files /dev/null and b/demo/pngsuite/basn3p04.png differ diff --git a/demo/pngsuite/basn3p08.png b/demo/pngsuite/basn3p08.png new file mode 100644 index 0000000..0ddad07 Binary files /dev/null and b/demo/pngsuite/basn3p08.png differ diff --git a/demo/pngsuite/basn4a08.png b/demo/pngsuite/basn4a08.png new file mode 100644 index 0000000..3e13052 Binary files /dev/null and b/demo/pngsuite/basn4a08.png differ diff --git a/demo/pngsuite/basn4a16.png b/demo/pngsuite/basn4a16.png new file mode 100644 index 0000000..8243644 Binary files /dev/null and b/demo/pngsuite/basn4a16.png differ diff --git a/demo/pngsuite/basn6a08.png b/demo/pngsuite/basn6a08.png new file mode 100644 index 0000000..e608738 Binary files /dev/null and b/demo/pngsuite/basn6a08.png differ diff --git a/demo/pngsuite/basn6a16.png b/demo/pngsuite/basn6a16.png new file mode 100644 index 0000000..984a995 Binary files /dev/null and b/demo/pngsuite/basn6a16.png differ diff --git a/demo/pngsuite/maskimage.png b/demo/pngsuite/maskimage.png new file mode 100644 index 0000000..d896aba Binary files /dev/null and b/demo/pngsuite/maskimage.png differ diff --git a/demo/raw_image_demo.pdf b/demo/raw_image_demo.pdf new file mode 100644 index 0000000..6ed513a Binary files /dev/null and b/demo/raw_image_demo.pdf differ diff --git a/demo/raw_image_demo.tsl b/demo/raw_image_demo.tsl new file mode 100644 index 0000000..0f2e918 --- /dev/null +++ b/demo/raw_image_demo.tsl @@ -0,0 +1,87 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "raw_image_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); +pdf.SetCompressionMode(TSPdfEnumerations.COMP_ALL); + +// create default-font +font := pdf.GetFont("Helvetica", ""); + +// add a new page object. +page := pdf.AddPage(); + +page.SetWidth(172); +page.SetHeight(80); + +height := page.GetHeight(); +page.BeginText(); +page.SetFontAndSize(font, 20); +page.MoveTextPos(220, height - 70); +page.ShowText("Raw Image Demo"); +page.EndText(); + + +raw_image_path := path + separator + "rawimage" + separator; +raw_image_file1 := raw_image_path + "32_32_rgb.dat"; +// load RGB raw-image file. +image := pdf.LoadRawImageFromFile(alias, raw_image_file1, 32, 32, TSPdfEnumerations.CS_DEVICE_RGB); + +x := 20; +y := 20; + +// Draw image to the canvas. (normal-mode with actual size.)// +page.DrawImage(image, x, y, 32, 32); + +// load GrayScale raw-image file. +raw_image_file2 := raw_image_path + "32_32_gray.dat"; +image := pdf.LoadRawImageFromFile(alias, raw_image_file2, 32, 32, TSPdfEnumerations.CS_DEVICE_GRAY); + +x := 70; +y := 20; + +// Draw image to the canvas. (normal-mode with actual size.)// +page.DrawImage(image, x, y, 32, 32); + +// load GrayScale raw-image (1bit) file from memory. +RAW_IMAGE_DATA := array( + "0xff", "0xff", "0xff", "0xfe", "0xff", "0xff", "0xff", "0xfc", + "0xff", "0xff", "0xff", "0xf8", "0xff", "0xff", "0xff", "0xf0", + "0xf3", "0xf3", "0xff", "0xe0", "0xf3", "0xf3", "0xff", "0xc0", + "0xf3", "0xf3", "0xff", "0x80", "0xf3", "0x33", "0xff", "0x00", + "0xf3", "0x33", "0xfe", "0x00", "0xf3", "0x33", "0xfc", "0x00", + "0xf8", "0x07", "0xf8", "0x00", "0xf8", "0x07", "0xf0", "0x00", + "0xfc", "0xcf", "0xe0", "0x00", "0xfc", "0xcf", "0xc0", "0x00", + "0xff", "0xff", "0x80", "0x00", "0xff", "0xff", "0x00", "0x00", + "0xff", "0xfe", "0x00", "0x00", "0xff", "0xfc", "0x00", "0x00", + "0xff", "0xf8", "0x0f", "0xe0", "0xff", "0xf0", "0x0f", "0xe0", + "0xff", "0xe0", "0x0c", "0x30", "0xff", "0xc0", "0x0c", "0x30", + "0xff", "0x80", "0x0f", "0xe0", "0xff", "0x00", "0x0f", "0xe0", + "0xfe", "0x00", "0x0c", "0x30", "0xfc", "0x00", "0x0c", "0x30", + "0xf8", "0x00", "0x0f", "0xe0", "0xf0", "0x00", "0x0f", "0xe0", + "0xe0", "0x00", "0x00", "0x00", "0xc0", "0x00", "0x00", "0x00", + "0x80", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00" +); +RAW_IMAGE_DATA := array2str(RAW_IMAGE_DATA, ""); +RAW_IMAGE_DATA := DecoderAdixstr(RAW_IMAGE_DATA, 2, 16); +image := pdf.LoadRawImageFromMem(Binary(RAW_IMAGE_DATA), 32, 32, TSPdfEnumerations.CS_DEVICE_GRAY, 1); + +x := 120; +y := 20; + +// Draw image to the canvas. (normal-mode with actual size.)// +page.DrawImage(image, x, y, 32, 32); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; diff --git a/demo/rawimage/32_32_2color.dat b/demo/rawimage/32_32_2color.dat new file mode 100644 index 0000000..77cef94 Binary files /dev/null and b/demo/rawimage/32_32_2color.dat differ diff --git a/demo/rawimage/32_32_gray.dat b/demo/rawimage/32_32_gray.dat new file mode 100644 index 0000000..82ea9e5 Binary files /dev/null and b/demo/rawimage/32_32_gray.dat differ diff --git a/demo/rawimage/32_32_rgb.dat b/demo/rawimage/32_32_rgb.dat new file mode 100644 index 0000000..f728d48 Binary files /dev/null and b/demo/rawimage/32_32_rgb.dat differ diff --git a/demo/text_annotation_demo.pdf b/demo/text_annotation_demo.pdf new file mode 100644 index 0000000..4a5c5e8 --- /dev/null +++ b/demo/text_annotation_demo.pdf @@ -0,0 +1,198 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 5 0 R ] +/Count 1 +>> +endobj +3 0 obj +<< +/Producer (Haru Free PDF Library 2.4.4) +>> +endobj +4 0 obj +<< +/Type /Font +/BaseFont /Times-Roman +/Subtype /Type1 +/Encoding /WinAnsiEncoding +>> +endobj +5 0 obj +<< +/Type /Page +/MediaBox [ 0 0 400 500 ] +/Contents 6 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 4 0 R +>> +>> +/Parent 2 0 R +/Annots [ 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R 15 0 R ] +>> +endobj +6 0 obj +<< +/Length 7 0 R +>> +stream +BT +/F1 16 Tf +130 450 Td +(Annotation Demo) Tj +ET +/F1 11 Tf +BT +85 380 Td +(Comment Icon.) Tj +ET +BT +245 380 Td +(Key Icon) Tj +ET +BT +85 280 Td +(Note Icon.) Tj +ET +BT +245 280 Td +(Help Icon) Tj +ET +BT +85 180 Td +(NewParagraph Icon) Tj +ET +BT +245 180 Td +(Paragraph Icon) Tj +ET +BT +85 80 Td +(Insert Icon) Tj +ET +BT +245 80 Td +(Text Icon\050ISO8859-2 text\051) Tj +ET + +endstream +endobj +7 0 obj +349 +endobj +8 0 obj +<< +/Rect [ 50 350 150 400 ] +/Type /Annot +/Subtype /Text +/Contents (Annotation with Comment Icon. \012 This annotation set to be opened initially.) +/P 5 0 R +/Name /Key +>> +endobj +9 0 obj +<< +/Rect [ 210 350 350 400 ] +/Type /Annot +/Subtype /Text +/Contents (Annotation with Key Icon) +/P 5 0 R +/Name /Paragraph +>> +endobj +10 0 obj +<< +/Rect [ 50 250 150 300 ] +/Type /Annot +/Subtype /Text +/Contents (Annotation with Note Icon) +/P 5 0 R +/Name /Note +>> +endobj +11 0 obj +<< +/Rect [ 210 250 350 300 ] +/Type /Annot +/Subtype /Text +/Contents (Annotation with Help Icon) +/P 5 0 R +/Name /Help +>> +endobj +12 0 obj +<< +/Rect [ 50 150 150 200 ] +/Type /Annot +/Subtype /Text +/Contents (Annotation with NewParagraph Icon) +/P 5 0 R +/Name /NewParagraph +>> +endobj +13 0 obj +<< +/Rect [ 210 150 350 200 ] +/Type /Annot +/Subtype /Text +/Contents (Annotation with Paragraph Icon) +/P 5 0 R +/Name /Paragraph +>> +endobj +14 0 obj +<< +/Rect [ 50 50 150 100 ] +/Type /Annot +/Subtype /Text +/Contents (Annotation with Insert Icon) +/P 5 0 R +/Name /Insert +>> +endobj +15 0 obj +<< +/Rect [ 210 50 350 100 ] +/Type /Annot +/Subtype /Text +/Contents +/P 5 0 R +>> +endobj +xref +0 16 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000184 00000 n +0000000283 00000 n +0000000525 00000 n +0000000928 00000 n +0000000947 00000 n +0000001132 00000 n +0000001270 00000 n +0000001404 00000 n +0000001539 00000 n +0000001689 00000 n +0000001834 00000 n +0000001971 00000 n +trailer +<< +/Root 1 0 R +/Info 3 0 R +/Size 16 +>> +startxref +2244 +%%EOF diff --git a/demo/text_annotation_demo.tsl b/demo/text_annotation_demo.tsl new file mode 100644 index 0000000..3d87a2d --- /dev/null +++ b/demo/text_annotation_demo.tsl @@ -0,0 +1,112 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "text_annotation_demo.pdf"; +output_file := path + separator + output_file; + +pdf := new PdfFile(); +// use Times-Roman font. +font := pdf.GetFont("Times-Roman", "WinAnsiEncoding"); + +page := pdf.AddPage(); + +page.SetWidth(400); +page.SetHeight(500); + +page.BeginText(); +page.SetFontAndSize(font, 16); +page.MoveTextPos(130, 450); +page.ShowText("Annotation Demo"); +page.EndText(); + +rect1 := array(50, 350, 150, 400); +rect2 := array(210, 350, 350, 400); +rect3 := array(50, 250, 150, 300); +rect4 := array(210, 250, 350, 300); +rect5 := array(50, 150, 150, 200); +rect6 := array(210, 150, 350, 200); +rect7 := array(50, 50, 150, 100); +rect8 := array(210, 50, 350, 100); + + +annotation := page.CreateTextAnnot(rect1, "Annotation with Comment Icon. \n This annotation set to be opened initially.", nil); + +annotation.TextAnnotSetIcon(TSPdfEnumerations.ANNOT_ICON_COMMENT); +annotation.TextAnnotSetOpened(true); + +annotation := page.CreateTextAnnot(rect2, "Annotation with Key Icon", nil); +annotation.TextAnnotSetIcon(TSPdfEnumerations.ANNOT_ICON_PARAGRAPH); + +annotation := page.CreateTextAnnot(rect3, "Annotation with Note Icon", nil); +annotation.TextAnnotSetIcon(TSPdfEnumerations.ANNOT_ICON_NOTE); + +annotation := page.CreateTextAnnot(rect4, "Annotation with Help Icon", nil); +annotation.TextAnnotSetIcon(TSPdfEnumerations.ANNOT_ICON_HELP); + +annotation := page.CreateTextAnnot(rect5, "Annotation with NewParagraph Icon", nil); +annotation.TextAnnotSetIcon(TSPdfEnumerations.ANNOT_ICON_NEW_PARAGRAPH); + +annotation := page.CreateTextAnnot(rect6, "Annotation with Paragraph Icon", nil); +annotation.TextAnnotSetIcon(TSPdfEnumerations.ANNOT_ICON_PARAGRAPH); + +annotation := page.CreateTextAnnot(rect7, "Annotation with Insert Icon", nil); +annotation.TextAnnotSetIcon(TSPdfEnumerations.ANNOT_ICON_INSERT); + +encoding := pdf.GetEncoder("ISO8859-2"); + +page.CreateTextAnnot(rect8, "Annotation with ISO8859 text стужвьы", encoding); + +page.SetFontAndSize(font, 11); + +page.BeginText(); +page.MoveTextPos(rect1[0] + 35, rect1[3] - 20); +page.ShowText("Comment Icon."); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(rect2[0] + 35, rect2[3] - 20); +page.ShowText("Key Icon"); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(rect3[0] + 35, rect3[3] - 20); +page.ShowText("Note Icon."); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(rect4[0] + 35, rect4[3] - 20); +page.ShowText("Help Icon"); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(rect5[0] + 35, rect5[3] - 20); +page.ShowText("NewParagraph Icon"); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(rect6[0] + 35, rect6[3] - 20); +page.ShowText("Paragraph Icon"); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(rect7[0] + 35, rect7[3] - 20); +page.ShowText("Insert Icon"); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(rect8[0] + 35, rect8[3] - 20); +page.ShowText("Text Icon(ISO8859-2 text)"); +page.EndText(); + + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; diff --git a/demo/text_demo.pdf b/demo/text_demo.pdf new file mode 100644 index 0000000..ac844c2 Binary files /dev/null and b/demo/text_demo.pdf differ diff --git a/demo/text_demo.tsl b/demo/text_demo.tsl new file mode 100644 index 0000000..6b66188 --- /dev/null +++ b/demo/text_demo.tsl @@ -0,0 +1,389 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "text_demo.pdf"; +output_file := path + separator + output_file; + +page_title := "Text Demo"; +pdf := new PdfFile(); + +// set compression mode +pdf.SetCompressionMode(TSPdfEnumerations.COMP_ALL); + +// create default-font +font := pdf.GetFont("Helvetica", ""); + +// add a new page object. +page := pdf.AddPage(); + +// draw grid to the page +PrintGrid(pdf, page); + +width := page.GetWidth(); +height := page.GetHeight(); + +// print the title of the page (with positioning center). +page.SetFontAndSize(font, 24); +tw := page.TextWidth(page_title); +page.BeginText(); +page.TextOut((width - tw) / 2, height - 50, page_title); +page.EndText(); + +page.BeginText(); +page.MoveTextPos(60, height - 60); + +// font size +fsize := 8; +samp_text := "abcdefgABCDEFG123!#$%&+-@?"; +samp_text2 := "The quick brown fox jumps over the lazy dog."; +while (fsize < 60) do +begin + // set style and size of font. + page.SetFontAndSize(font, fsize); + + // set the position of the text. + page.MoveTextPos(0, -5 - fsize); + + // measure the number of characters which included in the page. + len := page.MeasureText(samp_text, width - 120, false, ""); + buf := samp_text[:len]; + page.ShowText(buf); + + // print the description. + page.MoveTextPos(0, -10); + page.SetFontAndSize(font, 8); + page.ShowText("Fontsize=" $ fsize); + + fsize *= 1.5; +end + +// font color +page.SetFontAndSize(font, 8); +page.MoveTextPos(0, -30); +page.ShowText("Font color"); + +page.SetFontAndSize(font, 18); +page.MoveTextPos(0, -20); +len := length(samp_text); +for i:=0 to len - 1 do +begin + r := i / len; + g := 1 - i / len; + buf := samp_text[integer(i + 1)]; + page.SetRGBFill(r, g, 0.0); + page.ShowText(buf); +end +page.MoveTextPos(0, -25); + +for i:=0 to len - 1 do +begin + r := i / len; + b := 1 - i / len; + buf := samp_text[integer(i + 1)]; + + page.SetRGBFill(r, 0.0, b); + page.ShowText(buf); +end +page.MoveTextPos(0, -25); + +for i:=0 to len - 1 do +begin + b := i / len; + g := 1 - i / len; + buf := samp_text[integer(i + 1)]; + + page.SetRGBFill(0.0, g, b); + page.ShowText(buf); +end +page.EndText(); + +ypos := 450; +// Font rendering mode +page.SetFontAndSize(font, 32); +page.SetRGBFill(0.5, 0.5, 0.0); +page.SetLineWidth(1.5); + +// PDF_FILL +ShowDescription(page, 60, ypos, "RenderingMode=PDF_FILL"); +page.SetTextRenderingMode(TSPdfEnumerations.FILL); +page.BeginText(); +page.TextOut(60, ypos, "ABCabc123"); +page.EndText(); + +// PDF_STROKE +ShowDescription(page, 60, ypos - 50, "RenderingMode=PDF_STROKE"); +page.SetTextRenderingMode(TSPdfEnumerations.STROKE); +page.BeginText(); +page.TextOut(60, ypos - 50, "ABCabc123"); +page.EndText(); + +// PDF_FILL_THEN_STROKE +ShowDescription(page, 60, ypos - 100, "RenderingMode=PDF_FILL_THEN_STROKE"); +page.SetTextRenderingMode(TSPdfEnumerations.FILL_THEN_STROKE); +page.BeginText(); +page.TextOut(60, ypos - 100, "ABCabc123"); +page.EndText(); + +// PDF_FILL_CLIPPING +ShowDescription(page, 60, ypos - 150, "RenderingMode=PDF_FILL_CLIPPING"); +page.GSave(); +page.SetTextRenderingMode(TSPdfEnumerations.FILL_CLIPPING); +page.BeginText(); +page.TextOut(60, ypos - 150, "ABCabc123"); +page.EndText(); +ShowStripePattern(page, 60, ypos - 150); +page.GRestore(); + +// PDF_STROKE_CLIPPING +ShowDescription(page, 60, ypos - 200, "RenderingMode=PDF_STROKE_CLIPPING"); +page.GSave(); +page.SetTextRenderingMode(TSPdfEnumerations.STROKE_CLIPPING); +page.BeginText(); +page.TextOut(60, ypos - 200, "ABCabc123"); +page.EndText(); +ShowStripePattern(page, 60, ypos - 200); +page.GRestore(); + +// PDF_FILL_STROKE_CLIPPING +ShowDescription(page, 60, ypos - 250, + "RenderingMode=PDF_FILL_STROKE_CLIPPING"); +page.GSave(); +page.SetTextRenderingMode(TSPdfEnumerations.FILL_STROKE_CLIPPING); +page.BeginText(); +page.TextOut(60, ypos - 250, "ABCabc123"); +page.EndText(); +ShowStripePattern(page, 60, ypos - 250); +page.GRestore(); + +// Reset text attributes +page.SetTextRenderingMode(TSPdfEnumerations.FILL); +page.SetRGBFill(0, 0, 0); +page.SetFontAndSize(font, 30); + + +// Rotating text + +angle1 := 30; // A rotation of 30 degrees. +rad1 := angle1 / 180 / 3.141592; // Calcurate the radian value. + +ShowDescription(page, 320, ypos - 60, "Rotating text"); +page.BeginText(); +page.SetTextMatrix(cos(rad1), sin(rad1), -sin(rad1), cos(rad1), 330, ypos - 60); +page.ShowText("ABCabc123"); +page.EndText(); + + +// Skewing text. +ShowDescription(page, 320, ypos - 120, "Skewing text"); +page.BeginText(); + +angle1 := 10; +angle2 := 20; +rad1 := angle1 / 180 / 3.141592; +rad2 := angle2 / 180 / 3.141592; + +page.SetTextMatrix(1, tan(rad1), tan(rad2), 1, 320, ypos - 120); +page.ShowText("ABCabc123"); +page.EndText(); + + +// scaling text (X direction) +ShowDescription(page, 320, ypos - 175, "Scaling text (X direction)"); +page.BeginText(); +page.SetTextMatrix(1.5, 0, 0, 1, 320, ypos - 175); +page.ShowText("ABCabc12"); +page.EndText(); + + +// scaling text (Y direction) + +ShowDescription(page, 320, ypos - 250, "Scaling text (Y direction)"); +page.BeginText(); +page.SetTextMatrix(1, 0, 0, 2, 320, ypos - 250); +page.ShowText("ABCabc123"); +page.EndText(); + + +// char spacing, word spacing +ShowDescription(page, 60, 140, "char-spacing 0"); +ShowDescription(page, 60, 100, "char-spacing 1.5"); +ShowDescription(page, 60, 60, "char-spacing 1.5, word-spacing 2.5"); + +page.SetFontAndSize(font, 20); +page.SetRGBFill(0.1, 0.3, 0.1); + +// char-spacing 0 +page.BeginText(); +page.TextOut(60, 140, samp_text2); +page.EndText(); + +// char-spacing 1.5 +page.SetCharSpace(1.5); + +page.BeginText(); +page.TextOut(60, 100, samp_text2); +page.EndText(); + +// char-spacing 1.5, word-spacing 3.5 +page.SetWordSpace(2.5); + +page.BeginText(); +page.TextOut(60, 60, samp_text2); +page.EndText(); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function ShowStripePattern(page, x, y) +Begin + iy := 0; + text_width := page.TextWidth("ABCabc123"); + while iy < 50 do + begin + page.SetRGBStroke(0.0, 0.0, 0.5); + page.SetLineWidth(1); + page.MoveTo(x, y + iy); + page.LineTo(x + text_width, y + iy); + page.Stroke(); + iy += 3; + end + page.SetLineWidth(2.5); +End; + + +Function ShowDescription(page, x, y, text) +Begin + fsize := page.GetCurrentFontSize(); + font := page.GetCurrentFont(); + rgb := page.GetRGBFill(); + + page.BeginText(); + page.SetRGBFill(0, 0, 0); + page.SetTextRenderingMode(TSPdfEnumerations.FILL); + page.SetFontAndSize(font, 10); + page.TextOut(x, y - 12, text); + page.EndText(); + + page.SetFontAndSize(font, fsize); + [r, g, b] := rgb; + page.SetRGBFill(r, g, b); +End; + +Function PrintGrid(pdf, page) +Begin + height := page.GetHeight(); + width := page.GetWidth(); + font := pdf.GetFont("Helvetica", ""); + + page.SetFontAndSize(font, 5); + page.SetGrayFill(0.5); + page.SetGrayStroke(0.8); + + // Draw horizontal lines + y := 0; + while y < height do + begin + if y % 10 = 0 then + page.SetLineWidth(0.5); + else begin + wid := page.GetWidth(); + if wid <> 0.25 then page.SetLineWidth(0.25); + end + + page.MoveTo(0, y); + page.LineTo(width, y); + page.Stroke(); + + if y % 10 = 0 and y > 0 then + begin + page.SetGrayStroke(0.5); + + page.MoveTo(0, y); + page.LineTo(5, y); + page.Stroke(); + page.SetGrayStroke(0.8); + end + + y += 5; + end + + + // Draw vertical lines + x := 0; + while x < width do + begin + if x % 10 = 0 then + page.SetLineWidth(0.5); + else + if page.GetWidth() <> 0.25 then page.SetLineWidth(0.25); + + page.MoveTo(x, 0); + page.LineTo(x, height); + page.Stroke(); + + if x % 50 = 0 and x > 0 then + begin + page.SetGrayStroke(0.5); + + page.MoveTo(x, 0); + page.LineTo(x, 5); + page.Stroke(); + + page.MoveTo(x, height); + page.LineTo(x, height - 5); + page.Stroke(); + + page.SetGrayStroke(0.8); + end + + x += 5; + end + + // Draw horizontal text + y := 0; + while y < height do + begin + if y % 10 = 0 and y > 0 then + begin + page.BeginText(); + page.MoveTextPos(5, y - 2); + page.ShowText(tostring(y)); + page.EndText(); + end + y += 5; + end + + + // Draw vertical text + x := 0; + while x < width do + begin + if x % 50 = 0 and x > 0 then + begin + buf := tostring(x); + page.BeginText(); + page.MoveTextPos(x, 5); + page.ShowText(buf); + page.EndText(); + + page.BeginText(); + page.MoveTextPos(x, height - 10); + page.ShowText(buf); + page.EndText(); + end + + x += 5; + end + + page.SetGrayFill(0); + page.SetGrayStroke(0); +End; diff --git a/demo/text_demo2.pdf b/demo/text_demo2.pdf new file mode 100644 index 0000000..8161af9 --- /dev/null +++ b/demo/text_demo2.pdf @@ -0,0 +1,1744 @@ +%PDF-1.3 +% +1 0 obj +<< +/Type /Catalog +/Pages 2 0 R +>> +endobj +2 0 obj +<< +/Type /Pages +/Kids [ 4 0 R ] +/Count 1 +>> +endobj +3 0 obj +<< +/Producer (Haru Free PDF Library 2.4.4) +>> +endobj +4 0 obj +<< +/Type /Page +/MediaBox [ 0 0 419.52801 595.276 ] +/Contents 5 0 R +/Resources << +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] +/Font << +/F1 7 0 R +/F2 8 0 R +>> +>> +/Parent 2 0 R +>> +endobj +5 0 obj +<< +/Length 6 0 R +>> +stream +/F1 5 Tf +0.5 g +0.8 G +0.5 w +0 0 m +419.52801 0 l +S +0.25 w +0 5 m +419.52801 5 l +S +0.5 w +0 10 m +419.52801 10 l +S +0.5 G +0 10 m +5 10 l +S +0.8 G +0.25 w +0 15 m +419.52801 15 l +S +0.5 w +0 20 m +419.52801 20 l +S +0.5 G +0 20 m +5 20 l +S +0.8 G +0.25 w +0 25 m +419.52801 25 l +S +0.5 w +0 30 m +419.52801 30 l +S +0.5 G +0 30 m +5 30 l +S +0.8 G +0.25 w +0 35 m +419.52801 35 l +S +0.5 w +0 40 m +419.52801 40 l +S +0.5 G +0 40 m +5 40 l +S +0.8 G +0.25 w +0 45 m +419.52801 45 l +S +0.5 w +0 50 m +419.52801 50 l +S +0.5 G +0 50 m +5 50 l +S +0.8 G +0.25 w +0 55 m +419.52801 55 l +S +0.5 w +0 60 m +419.52801 60 l +S +0.5 G +0 60 m +5 60 l +S +0.8 G +0.25 w +0 65 m +419.52801 65 l +S +0.5 w +0 70 m +419.52801 70 l +S +0.5 G +0 70 m +5 70 l +S +0.8 G +0.25 w +0 75 m +419.52801 75 l +S +0.5 w +0 80 m +419.52801 80 l +S +0.5 G +0 80 m +5 80 l +S +0.8 G +0.25 w +0 85 m +419.52801 85 l +S +0.5 w +0 90 m +419.52801 90 l +S +0.5 G +0 90 m +5 90 l +S +0.8 G +0.25 w +0 95 m +419.52801 95 l +S +0.5 w +0 100 m +419.52801 100 l +S +0.5 G +0 100 m +5 100 l +S +0.8 G +0.25 w +0 105 m +419.52801 105 l +S +0.5 w +0 110 m +419.52801 110 l +S +0.5 G +0 110 m +5 110 l +S +0.8 G +0.25 w +0 115 m +419.52801 115 l +S +0.5 w +0 120 m +419.52801 120 l +S +0.5 G +0 120 m +5 120 l +S +0.8 G +0.25 w +0 125 m +419.52801 125 l +S +0.5 w +0 130 m +419.52801 130 l +S +0.5 G +0 130 m +5 130 l +S +0.8 G +0.25 w +0 135 m +419.52801 135 l +S +0.5 w +0 140 m +419.52801 140 l +S +0.5 G +0 140 m +5 140 l +S +0.8 G +0.25 w +0 145 m +419.52801 145 l +S +0.5 w +0 150 m +419.52801 150 l +S +0.5 G +0 150 m +5 150 l +S +0.8 G +0.25 w +0 155 m +419.52801 155 l +S +0.5 w +0 160 m +419.52801 160 l +S +0.5 G +0 160 m +5 160 l +S +0.8 G +0.25 w +0 165 m +419.52801 165 l +S +0.5 w +0 170 m +419.52801 170 l +S +0.5 G +0 170 m +5 170 l +S +0.8 G +0.25 w +0 175 m +419.52801 175 l +S +0.5 w +0 180 m +419.52801 180 l +S +0.5 G +0 180 m +5 180 l +S +0.8 G +0.25 w +0 185 m +419.52801 185 l +S +0.5 w +0 190 m +419.52801 190 l +S +0.5 G +0 190 m +5 190 l +S +0.8 G +0.25 w +0 195 m +419.52801 195 l +S +0.5 w +0 200 m +419.52801 200 l +S +0.5 G +0 200 m +5 200 l +S +0.8 G +0.25 w +0 205 m +419.52801 205 l +S +0.5 w +0 210 m +419.52801 210 l +S +0.5 G +0 210 m +5 210 l +S +0.8 G +0.25 w +0 215 m +419.52801 215 l +S +0.5 w +0 220 m +419.52801 220 l +S +0.5 G +0 220 m +5 220 l +S +0.8 G +0.25 w +0 225 m +419.52801 225 l +S +0.5 w +0 230 m +419.52801 230 l +S +0.5 G +0 230 m +5 230 l +S +0.8 G +0.25 w +0 235 m +419.52801 235 l +S +0.5 w +0 240 m +419.52801 240 l +S +0.5 G +0 240 m +5 240 l +S +0.8 G +0.25 w +0 245 m +419.52801 245 l +S +0.5 w +0 250 m +419.52801 250 l +S +0.5 G +0 250 m +5 250 l +S +0.8 G +0.25 w +0 255 m +419.52801 255 l +S +0.5 w +0 260 m +419.52801 260 l +S +0.5 G +0 260 m +5 260 l +S +0.8 G +0.25 w +0 265 m +419.52801 265 l +S +0.5 w +0 270 m +419.52801 270 l +S +0.5 G +0 270 m +5 270 l +S +0.8 G +0.25 w +0 275 m +419.52801 275 l +S +0.5 w +0 280 m +419.52801 280 l +S +0.5 G +0 280 m +5 280 l +S +0.8 G +0.25 w +0 285 m +419.52801 285 l +S +0.5 w +0 290 m +419.52801 290 l +S +0.5 G +0 290 m +5 290 l +S +0.8 G +0.25 w +0 295 m +419.52801 295 l +S +0.5 w +0 300 m +419.52801 300 l +S +0.5 G +0 300 m +5 300 l +S +0.8 G +0.25 w +0 305 m +419.52801 305 l +S +0.5 w +0 310 m +419.52801 310 l +S +0.5 G +0 310 m +5 310 l +S +0.8 G +0.25 w +0 315 m +419.52801 315 l +S +0.5 w +0 320 m +419.52801 320 l +S +0.5 G +0 320 m +5 320 l +S +0.8 G +0.25 w +0 325 m +419.52801 325 l +S +0.5 w +0 330 m +419.52801 330 l +S +0.5 G +0 330 m +5 330 l +S +0.8 G +0.25 w +0 335 m +419.52801 335 l +S +0.5 w +0 340 m +419.52801 340 l +S +0.5 G +0 340 m +5 340 l +S +0.8 G +0.25 w +0 345 m +419.52801 345 l +S +0.5 w +0 350 m +419.52801 350 l +S +0.5 G +0 350 m +5 350 l +S +0.8 G +0.25 w +0 355 m +419.52801 355 l +S +0.5 w +0 360 m +419.52801 360 l +S +0.5 G +0 360 m +5 360 l +S +0.8 G +0.25 w +0 365 m +419.52801 365 l +S +0.5 w +0 370 m +419.52801 370 l +S +0.5 G +0 370 m +5 370 l +S +0.8 G +0.25 w +0 375 m +419.52801 375 l +S +0.5 w +0 380 m +419.52801 380 l +S +0.5 G +0 380 m +5 380 l +S +0.8 G +0.25 w +0 385 m +419.52801 385 l +S +0.5 w +0 390 m +419.52801 390 l +S +0.5 G +0 390 m +5 390 l +S +0.8 G +0.25 w +0 395 m +419.52801 395 l +S +0.5 w +0 400 m +419.52801 400 l +S +0.5 G +0 400 m +5 400 l +S +0.8 G +0.25 w +0 405 m +419.52801 405 l +S +0.5 w +0 410 m +419.52801 410 l +S +0.5 G +0 410 m +5 410 l +S +0.8 G +0.25 w +0 415 m +419.52801 415 l +S +0.5 w +0 420 m +419.52801 420 l +S +0.5 G +0 420 m +5 420 l +S +0.8 G +0.25 w +0 425 m +419.52801 425 l +S +0.5 w +0 430 m +419.52801 430 l +S +0.5 G +0 430 m +5 430 l +S +0.8 G +0.25 w +0 435 m +419.52801 435 l +S +0.5 w +0 440 m +419.52801 440 l +S +0.5 G +0 440 m +5 440 l +S +0.8 G +0.25 w +0 445 m +419.52801 445 l +S +0.5 w +0 450 m +419.52801 450 l +S +0.5 G +0 450 m +5 450 l +S +0.8 G +0.25 w +0 455 m +419.52801 455 l +S +0.5 w +0 460 m +419.52801 460 l +S +0.5 G +0 460 m +5 460 l +S +0.8 G +0.25 w +0 465 m +419.52801 465 l +S +0.5 w +0 470 m +419.52801 470 l +S +0.5 G +0 470 m +5 470 l +S +0.8 G +0.25 w +0 475 m +419.52801 475 l +S +0.5 w +0 480 m +419.52801 480 l +S +0.5 G +0 480 m +5 480 l +S +0.8 G +0.25 w +0 485 m +419.52801 485 l +S +0.5 w +0 490 m +419.52801 490 l +S +0.5 G +0 490 m +5 490 l +S +0.8 G +0.25 w +0 495 m +419.52801 495 l +S +0.5 w +0 500 m +419.52801 500 l +S +0.5 G +0 500 m +5 500 l +S +0.8 G +0.25 w +0 505 m +419.52801 505 l +S +0.5 w +0 510 m +419.52801 510 l +S +0.5 G +0 510 m +5 510 l +S +0.8 G +0.25 w +0 515 m +419.52801 515 l +S +0.5 w +0 520 m +419.52801 520 l +S +0.5 G +0 520 m +5 520 l +S +0.8 G +0.25 w +0 525 m +419.52801 525 l +S +0.5 w +0 530 m +419.52801 530 l +S +0.5 G +0 530 m +5 530 l +S +0.8 G +0.25 w +0 535 m +419.52801 535 l +S +0.5 w +0 540 m +419.52801 540 l +S +0.5 G +0 540 m +5 540 l +S +0.8 G +0.25 w +0 545 m +419.52801 545 l +S +0.5 w +0 550 m +419.52801 550 l +S +0.5 G +0 550 m +5 550 l +S +0.8 G +0.25 w +0 555 m +419.52801 555 l +S +0.5 w +0 560 m +419.52801 560 l +S +0.5 G +0 560 m +5 560 l +S +0.8 G +0.25 w +0 565 m +419.52801 565 l +S +0.5 w +0 570 m +419.52801 570 l +S +0.5 G +0 570 m +5 570 l +S +0.8 G +0.25 w +0 575 m +419.52801 575 l +S +0.5 w +0 580 m +419.52801 580 l +S +0.5 G +0 580 m +5 580 l +S +0.8 G +0.25 w +0 585 m +419.52801 585 l +S +0.5 w +0 590 m +419.52801 590 l +S +0.5 G +0 590 m +5 590 l +S +0.8 G +0.25 w +0 595 m +419.52801 595 l +S +0.5 w +0 0 m +0 595.276 l +S +0.25 w +5 0 m +5 595.276 l +S +0.5 w +10 0 m +10 595.276 l +S +0.25 w +15 0 m +15 595.276 l +S +0.5 w +20 0 m +20 595.276 l +S +0.25 w +25 0 m +25 595.276 l +S +0.5 w +30 0 m +30 595.276 l +S +0.25 w +35 0 m +35 595.276 l +S +0.5 w +40 0 m +40 595.276 l +S +0.25 w +45 0 m +45 595.276 l +S +0.5 w +50 0 m +50 595.276 l +S +0.5 G +50 0 m +50 5 l +S +50 595.276 m +50 590.276 l +S +0.8 G +0.25 w +55 0 m +55 595.276 l +S +0.5 w +60 0 m +60 595.276 l +S +0.25 w +65 0 m +65 595.276 l +S +0.5 w +70 0 m +70 595.276 l +S +0.25 w +75 0 m +75 595.276 l +S +0.5 w +80 0 m +80 595.276 l +S +0.25 w +85 0 m +85 595.276 l +S +0.5 w +90 0 m +90 595.276 l +S +0.25 w +95 0 m +95 595.276 l +S +0.5 w +100 0 m +100 595.276 l +S +0.5 G +100 0 m +100 5 l +S +100 595.276 m +100 590.276 l +S +0.8 G +0.25 w +105 0 m +105 595.276 l +S +0.5 w +110 0 m +110 595.276 l +S +0.25 w +115 0 m +115 595.276 l +S +0.5 w +120 0 m +120 595.276 l +S +0.25 w +125 0 m +125 595.276 l +S +0.5 w +130 0 m +130 595.276 l +S +0.25 w +135 0 m +135 595.276 l +S +0.5 w +140 0 m +140 595.276 l +S +0.25 w +145 0 m +145 595.276 l +S +0.5 w +150 0 m +150 595.276 l +S +0.5 G +150 0 m +150 5 l +S +150 595.276 m +150 590.276 l +S +0.8 G +0.25 w +155 0 m +155 595.276 l +S +0.5 w +160 0 m +160 595.276 l +S +0.25 w +165 0 m +165 595.276 l +S +0.5 w +170 0 m +170 595.276 l +S +0.25 w +175 0 m +175 595.276 l +S +0.5 w +180 0 m +180 595.276 l +S +0.25 w +185 0 m +185 595.276 l +S +0.5 w +190 0 m +190 595.276 l +S +0.25 w +195 0 m +195 595.276 l +S +0.5 w +200 0 m +200 595.276 l +S +0.5 G +200 0 m +200 5 l +S +200 595.276 m +200 590.276 l +S +0.8 G +0.25 w +205 0 m +205 595.276 l +S +0.5 w +210 0 m +210 595.276 l +S +0.25 w +215 0 m +215 595.276 l +S +0.5 w +220 0 m +220 595.276 l +S +0.25 w +225 0 m +225 595.276 l +S +0.5 w +230 0 m +230 595.276 l +S +0.25 w +235 0 m +235 595.276 l +S +0.5 w +240 0 m +240 595.276 l +S +0.25 w +245 0 m +245 595.276 l +S +0.5 w +250 0 m +250 595.276 l +S +0.5 G +250 0 m +250 5 l +S +250 595.276 m +250 590.276 l +S +0.8 G +0.25 w +255 0 m +255 595.276 l +S +0.5 w +260 0 m +260 595.276 l +S +0.25 w +265 0 m +265 595.276 l +S +0.5 w +270 0 m +270 595.276 l +S +0.25 w +275 0 m +275 595.276 l +S +0.5 w +280 0 m +280 595.276 l +S +0.25 w +285 0 m +285 595.276 l +S +0.5 w +290 0 m +290 595.276 l +S +0.25 w +295 0 m +295 595.276 l +S +0.5 w +300 0 m +300 595.276 l +S +0.5 G +300 0 m +300 5 l +S +300 595.276 m +300 590.276 l +S +0.8 G +0.25 w +305 0 m +305 595.276 l +S +0.5 w +310 0 m +310 595.276 l +S +0.25 w +315 0 m +315 595.276 l +S +0.5 w +320 0 m +320 595.276 l +S +0.25 w +325 0 m +325 595.276 l +S +0.5 w +330 0 m +330 595.276 l +S +0.25 w +335 0 m +335 595.276 l +S +0.5 w +340 0 m +340 595.276 l +S +0.25 w +345 0 m +345 595.276 l +S +0.5 w +350 0 m +350 595.276 l +S +0.5 G +350 0 m +350 5 l +S +350 595.276 m +350 590.276 l +S +0.8 G +0.25 w +355 0 m +355 595.276 l +S +0.5 w +360 0 m +360 595.276 l +S +0.25 w +365 0 m +365 595.276 l +S +0.5 w +370 0 m +370 595.276 l +S +0.25 w +375 0 m +375 595.276 l +S +0.5 w +380 0 m +380 595.276 l +S +0.25 w +385 0 m +385 595.276 l +S +0.5 w +390 0 m +390 595.276 l +S +0.25 w +395 0 m +395 595.276 l +S +0.5 w +400 0 m +400 595.276 l +S +0.5 G +400 0 m +400 5 l +S +400 595.276 m +400 590.276 l +S +0.8 G +0.25 w +405 0 m +405 595.276 l +S +0.5 w +410 0 m +410 595.276 l +S +0.25 w +415 0 m +415 595.276 l +S +BT +5 8 Td +(10) Tj +ET +BT +5 18 Td +(20) Tj +ET +BT +5 28 Td +(30) Tj +ET +BT +5 38 Td +(40) Tj +ET +BT +5 48 Td +(50) Tj +ET +BT +5 58 Td +(60) Tj +ET +BT +5 68 Td +(70) Tj +ET +BT +5 78 Td +(80) Tj +ET +BT +5 88 Td +(90) Tj +ET +BT +5 98 Td +(100) Tj +ET +BT +5 108 Td +(110) Tj +ET +BT +5 118 Td +(120) Tj +ET +BT +5 128 Td +(130) Tj +ET +BT +5 138 Td +(140) Tj +ET +BT +5 148 Td +(150) Tj +ET +BT +5 158 Td +(160) Tj +ET +BT +5 168 Td +(170) Tj +ET +BT +5 178 Td +(180) Tj +ET +BT +5 188 Td +(190) Tj +ET +BT +5 198 Td +(200) Tj +ET +BT +5 208 Td +(210) Tj +ET +BT +5 218 Td +(220) Tj +ET +BT +5 228 Td +(230) Tj +ET +BT +5 238 Td +(240) Tj +ET +BT +5 248 Td +(250) Tj +ET +BT +5 258 Td +(260) Tj +ET +BT +5 268 Td +(270) Tj +ET +BT +5 278 Td +(280) Tj +ET +BT +5 288 Td +(290) Tj +ET +BT +5 298 Td +(300) Tj +ET +BT +5 308 Td +(310) Tj +ET +BT +5 318 Td +(320) Tj +ET +BT +5 328 Td +(330) Tj +ET +BT +5 338 Td +(340) Tj +ET +BT +5 348 Td +(350) Tj +ET +BT +5 358 Td +(360) Tj +ET +BT +5 368 Td +(370) Tj +ET +BT +5 378 Td +(380) Tj +ET +BT +5 388 Td +(390) Tj +ET +BT +5 398 Td +(400) Tj +ET +BT +5 408 Td +(410) Tj +ET +BT +5 418 Td +(420) Tj +ET +BT +5 428 Td +(430) Tj +ET +BT +5 438 Td +(440) Tj +ET +BT +5 448 Td +(450) Tj +ET +BT +5 458 Td +(460) Tj +ET +BT +5 468 Td +(470) Tj +ET +BT +5 478 Td +(480) Tj +ET +BT +5 488 Td +(490) Tj +ET +BT +5 498 Td +(500) Tj +ET +BT +5 508 Td +(510) Tj +ET +BT +5 518 Td +(520) Tj +ET +BT +5 528 Td +(530) Tj +ET +BT +5 538 Td +(540) Tj +ET +BT +5 548 Td +(550) Tj +ET +BT +5 558 Td +(560) Tj +ET +BT +5 568 Td +(570) Tj +ET +BT +5 578 Td +(580) Tj +ET +BT +5 588 Td +(590) Tj +ET +BT +50 5 Td +(50) Tj +ET +BT +50 585.276 Td +(50) Tj +ET +BT +100 5 Td +(100) Tj +ET +BT +100 585.276 Td +(100) Tj +ET +BT +150 5 Td +(150) Tj +ET +BT +150 585.276 Td +(150) Tj +ET +BT +200 5 Td +(200) Tj +ET +BT +200 585.276 Td +(200) Tj +ET +BT +250 5 Td +(250) Tj +ET +BT +250 585.276 Td +(250) Tj +ET +BT +300 5 Td +(300) Tj +ET +BT +300 585.276 Td +(300) Tj +ET +BT +350 5 Td +(350) Tj +ET +BT +350 585.276 Td +(350) Tj +ET +BT +400 5 Td +(400) Tj +ET +BT +400 585.276 Td +(400) Tj +ET +0 g +0 G +20 TL +25 505 175 40 re +S +BT +/F1 10 Tf +25 548 Td +(TSPdfEnumerations.TALIGN_LEFT) Tj +/F1 13 Tf +0 4.89697 Td +(The quick brown fox jumps) ' +(over the lazy dog.) ' +ET +220 505 175 40 re +S +BT +/F1 10 Tf +220 548 Td +(TSPdfEnumerations.TALIGN_RIGTH) Tj +/F1 13 Tf +20.39102 4.89697 Td +(The quick brown fox jumps) ' +48.38598 0 Td +(over the lazy dog.) ' +ET +25 435 175 40 re +S +BT +/F1 10 Tf +25 478 Td +(TSPdfEnumerations.TALIGN_CENTER) Tj +/F1 13 Tf +10.19551 4.897 Td +(The quick brown fox jumps) ' +24.19299 0 Td +(over the lazy dog.) ' +ET +220 435 175 40 re +S +BT +/F1 10 Tf +220 478 Td +(TSPdfEnumerations.TALIGN_JUSTIFY) Tj +/F1 13 Tf +0 4.897 Td +0.84962 Tc +(The quick brown fox jumps) ' +0 Tc +(over the lazy dog.) ' +ET +q +1 0.087488 0.17632 1 25 350 cm +0 0 175 40 re +S +BT +/F1 10 Tf +0 43 Td +(Skewed coordinate system) Tj +/F1 13 Tf +0 4.89699 Td +(The quick brown fox jumps) ' +(over the lazy dog.) ' +ET +Q +q +0.99619 0.087155 -0.087155 0.99619 220 350 cm +0 0 175 40 re +S +BT +/F1 10 Tf +0 43 Td +(Rotated coordinate system) Tj +/F1 13 Tf +0 4.89699 Td +(The quick brown fox jumps) ' +(over the lazy dog.) ' +ET +Q +0 G +65 190 m +65 270.04 129.95999 335 210 335 c +290.04 335 355 270.04 355 190 c +355 109.95999 290.04 45 210 45 c +129.95999 45 65 109.95999 65 190 c +97 190 m +97 252.376 147.62399 303 210 303 c +272.376 303 323 252.376 323 190 c +323 127.624 272.376 77 210 77 c +147.62399 77 97 127.624 97 190 c +S +BT +/F2 30 Tf +0.00000032679 1 -1 0.00000032679 88 190.00007 Tm +(T) Tj +0.13917 0.99026 -0.99026 0.13917 89.1873 206.97918 Tm +(h) Tj +0.27563 0.96126 -0.96126 0.27563 92.72608 223.62782 Tm +(e) Tj +0.40673 0.91354 -0.91354 0.40673 98.54748 239.62193 Tm +( ) Tj +0.52991 0.84804 -0.84804 0.52991 106.53816 254.6502 Tm +(q) Tj +0.64278 0.76604 -0.76604 0.64278 116.54261 268.42013 Tm +(u) Tj +0.74314 0.66913 -0.66913 0.74314 128.3661 280.66369 Tm +(i) Tj +0.82903 0.55919 -0.55919 0.82903 141.77851 291.1426 Tm +(c) Tj +0.89879 0.43837 -0.43837 0.89879 156.51876 299.65289 Tm +(k) Tj +0.95105 0.30901 -0.30901 0.95105 172.29997 306.0289 Tm +( ) Tj +0.9848 0.17364 -0.17364 0.9848 188.81497 310.14654 Tm +(b) Tj +0.99939 0.034899 -0.034899 0.99939 205.7423 311.92568 Tm +(r) Tj +0.99452 -0.10452 0.10452 0.99452 222.7525 311.33166 Tm +(o) Tj +0.97029 -0.24192 0.24192 0.97029 239.51451 308.37606 Tm +(w) Tj +0.92718 -0.3746 0.3746 0.92718 255.70202 303.11642 Tm +(n) Tj +0.86602 -0.49999 0.49999 0.86602 271.00003 295.65509 Tm +( ) Tj +0.78801 -0.61566 0.61566 0.78801 285.11071 286.13729 Tm +(f) Tj +0.69465 -0.71933 0.71933 0.69465 297.75946 274.74832 Tm +(o) Tj +0.58778 -0.80901 0.80901 0.58778 308.70007 261.70977 Tm +(x) Tj +0.46947 -0.88294 0.88294 0.46947 317.7196 247.27551 Tm +( ) Tj +0.34202 -0.93969 0.93969 0.34202 324.64251 231.72645 Tm +(j) Tj +0.20791 -0.97814 0.97814 0.20791 329.33401 215.36521 Tm +(u) Tj +0.069756 -0.99756 0.99756 0.069756 331.70281 198.51028 Tm +(m) Tj +-0.069756 -0.99756 0.99756 -0.069756 331.70281 181.48971 Tm +(p) Tj +-0.20791 -0.97814 0.97814 -0.20791 329.33401 164.63478 Tm +(s) Tj +-0.34201 -0.93969 0.93969 -0.34201 324.64251 148.27354 Tm +( ) Tj +-0.46947 -0.88294 0.88294 -0.46947 317.7196 132.72448 Tm +(o) Tj +-0.58778 -0.80901 0.80901 -0.58778 308.70007 118.29021 Tm +(v) Tj +-0.69465 -0.71934 0.71934 -0.69465 297.75946 105.25169 Tm +(e) Tj +-0.78801 -0.61566 0.61566 -0.78801 285.11071 93.8627 Tm +(r) Tj +-0.86602 -0.5 0.5 -0.86602 271.00003 84.34491 Tm +( ) Tj +-0.92718 -0.3746 0.3746 -0.92718 255.70202 76.88358 Tm +(t) Tj +-0.97029 -0.24192 0.24192 -0.97029 239.51451 71.62393 Tm +(h) Tj +-0.99452 -0.10452 0.10452 -0.99452 222.7525 68.66833 Tm +(e) Tj +-0.99939 0.034898 -0.034898 -0.99939 205.7423 68.07431 Tm +( ) Tj +-0.9848 0.17364 -0.17364 -0.9848 188.81497 69.85344 Tm +(l) Tj +-0.95105 0.30901 -0.30901 -0.95105 172.29997 73.97109 Tm +(a) Tj +-0.89879 0.43837 -0.43837 -0.89879 156.51876 80.3471 Tm +(z) Tj +-0.82903 0.55919 -0.55919 -0.82903 141.77851 88.85738 Tm +(y) Tj +-0.74314 0.66913 -0.66913 -0.74314 128.3661 99.33628 Tm +( ) Tj +-0.64278 0.76604 -0.76604 -0.64278 116.54261 111.57986 Tm +(d) Tj +-0.52992 0.84804 -0.84804 -0.52992 106.53816 125.34979 Tm +(o) Tj +-0.40673 0.91354 -0.91354 -0.40673 98.54748 140.37806 Tm +(g) Tj +-0.27563 0.96126 -0.96126 -0.27563 92.72608 156.37217 Tm +(.) Tj +-0.13917 0.99026 -0.99026 -0.13917 89.1873 173.02081 Tm +( ) Tj +ET + +endstream +endobj +6 0 obj +14667 +endobj +7 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +8 0 obj +<< +/Type /Font +/BaseFont /Courier-Bold +/Subtype /Type1 +/Encoding /StandardEncoding +>> +endobj +xref +0 9 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000184 00000 n +0000000380 00000 n +0000015101 00000 n +0000015122 00000 n +0000015220 00000 n +trailer +<< +/Root 1 0 R +/Info 3 0 R +/Size 9 +>> +startxref +15321 +%%EOF diff --git a/demo/text_demo2.tsl b/demo/text_demo2.tsl new file mode 100644 index 0000000..5a05ae4 --- /dev/null +++ b/demo/text_demo2.tsl @@ -0,0 +1,311 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "text_demo2.pdf"; +output_file := path + separator + output_file; + +no := 0; + +pdf := new PdfFile(); +SAMP_TXT := "The quick brown fox jumps over the lazy dog. "; + +// add a new page object. +page := pdf.AddPage(); +page.SetSize(TSPdfEnumerations.PAGE_SIZE_A5, TSPdfEnumerations.PAGE_PORTRAIT); + +PrintGrid(pdf, page); + +height := page.GetHeight(); + +font := pdf.GetFont("Helvetica", ""); +page.SetTextLeading(20); + +// TALIGN_LEFT +left := 25; +top := 545; +right := 200; +bottom := top - 40; + +page.Rectangle(left, bottom, right - left, top - bottom); +page.Stroke(); + +page.BeginText(); + +page.SetFontAndSize(font, 10); +page.TextOut(left, top + 3, "TSPdfEnumerations.TALIGN_LEFT"); + +page.SetFontAndSize(font, 13); +page.TextRect(left, top, right, bottom, SAMP_TXT, TSPdfEnumerations.TALIGN_LEFT, ""); + +page.EndText(); + +// TALIGN_RIGTH +left := 220; +right := 395; + +page.Rectangle(left, bottom, right - left, top - bottom); +page.Stroke(); + +page.BeginText(); + +page.SetFontAndSize(font, 10); +page.TextOut(left, top + 3, "TSPdfEnumerations.TALIGN_RIGTH"); + +page.SetFontAndSize(font, 13); +page.TextRect(left, top, right, bottom, SAMP_TXT, TSPdfEnumerations.TALIGN_RIGHT, ""); + +page.EndText(); + +// TALIGN_CENTER +left := 25; +top := 475; +right := 200; +bottom := top - 40; + +page.Rectangle(left, bottom, right - left, top - bottom); +page.Stroke(); + +page.BeginText(); + +page.SetFontAndSize(font, 10); +page.TextOut(left, top + 3, "TSPdfEnumerations.TALIGN_CENTER"); + +page.SetFontAndSize(font, 13); +page.TextRect(left, top, right, bottom, SAMP_TXT, TSPdfEnumerations.TALIGN_CENTER, ""); + +page.EndText(); + +// TALIGN_JUSTIFY +left := 220; +right := 395; + +page.Rectangle(left, bottom, right - left, top - bottom); +page.Stroke(); + +page.BeginText(); + +page.SetFontAndSize(font, 10); +page.TextOut(left, top + 3, "TSPdfEnumerations.TALIGN_JUSTIFY"); + +page.SetFontAndSize(font, 13); +page.TextRect(left, top, right, bottom, SAMP_TXT, TSPdfEnumerations.TALIGN_JUSTIFY, ""); +page.EndText(); + + + +// Skewed coordinate system +page.GSave(); +angle1 := 5; +angle2 := 10; +rad1 := angle1 / 180 * 3.141592; +rad2 := angle2 / 180 * 3.141592; + +page.Concat(1, tan(rad1), tan(rad2), 1, 25, 350); +left := 0; +top := 40; +right := 175; +bottom := 0; + +page.Rectangle(left, bottom, right - left, top - bottom); +page.Stroke(); + +page.BeginText(); + +page.SetFontAndSize(font, 10); +page.TextOut(left, top + 3, "Skewed coordinate system"); + +page.SetFontAndSize(font, 13); +page.TextRect(left, top, right, bottom, SAMP_TXT, TSPdfEnumerations.TALIGN_LEFT, ""); + +page.EndText(); + +page.GRestore(); + + +// Rotated coordinate system +page.GSave(); + +angle1 := 5; +rad1 := angle1 / 180 * 3.141592; + +page.Concat(cos(rad1), sin(rad1), -sin(rad1), cos(rad1), 220, 350); +left := 0; +top := 40; +right := 175; +bottom := 0; + +page.Rectangle(left, bottom, right - left, top - bottom); +page.Stroke(); + +page.BeginText(); + +page.SetFontAndSize(font, 10); +page.TextOut(left, top + 3, "Rotated coordinate system"); + +page.SetFontAndSize(font, 13); +page.TextRect(left, top, right, bottom, SAMP_TXT, TSPdfEnumerations.TALIGN_LEFT, ""); + +page.EndText(); + +page.GRestore(); + + +// text along a circle +page.SetGrayStroke(0); +page.Circle(210, 190, 145); +page.Circle(210, 190, 113); +page.Stroke(); + +angle1 := 360 /(length(SAMP_TXT)); +angle2 := 180; + +page.BeginText(); +font := pdf.GetFont("Courier-Bold", ""); +page.SetFontAndSize(font, 30); + +for i:=0 to length(SAMP_TXT)-1 do +begin + rad1 := (angle2 - 90) / 180 * 3.141592; + rad2 := angle2 / 180 * 3.141592; + + x := 210 + cos(rad2) * 122; + y := 190 + sin(rad2) * 122; + + page.SetTextMatrix(cos(rad1), sin(rad1), -sin(rad1), cos(rad1), x, y); + page.ShowText(SAMP_TXT[i+1]); + angle2 -= angle1; +end + +page.EndText(); + +// save the document to a file +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; + +Function PrintText(page, no) +Begin + point := page.GetCurrentTextPos(); + no++; + buf := format("[.%d%0.2f %0.2f%]", no, point[0], point[1]); + page.ShowText(buf); +End + +Function PrintGrid(pdf, page) +Begin + height := page.GetHeight(); + width := page.GetWidth(); + font := pdf.GetFont("Helvetica", ""); + + page.SetFontAndSize(font, 5); + page.SetGrayFill(0.5); + page.SetGrayStroke(0.8); + + // Draw horizontal lines + y := 0; + while y < height do + begin + if y % 10 = 0 then + page.SetLineWidth(0.5); + else begin + wid := page.GetWidth(); + if wid <> 0.25 then page.SetLineWidth(0.25); + end + + page.MoveTo(0, y); + page.LineTo(width, y); + page.Stroke(); + + if y % 10 = 0 and y > 0 then + begin + page.SetGrayStroke(0.5); + + page.MoveTo(0, y); + page.LineTo(5, y); + page.Stroke(); + page.SetGrayStroke(0.8); + end + + y += 5; + end + + + // Draw vertical lines + x := 0; + while x < width do + begin + if x % 10 = 0 then + page.SetLineWidth(0.5); + else begin + wid := page.GetWidth(); + if wid <> 0.25 then page.SetLineWidth(0.25); + end + + page.MoveTo(x, 0); + page.LineTo(x, height); + page.Stroke(); + + if x % 50 = 0 and x > 0 then + begin + page.SetGrayStroke(0.5); + + page.MoveTo(x, 0); + page.LineTo(x, 5); + page.Stroke(); + + page.MoveTo(x, height); + page.LineTo(x, height - 5); + page.Stroke(); + + page.SetGrayStroke(0.8); + end + + x += 5; + end + + // Draw horizontal text + y := 0; + while y < height do + begin + if y % 10 = 0 and y > 0 then + begin + page.BeginText(); + page.MoveTextPos(5, y - 2); + page.ShowText(tostring(y)); + page.EndText(); + end + y += 5; + end + + + // Draw vertical text + x := 0; + while x < width do + begin + if x % 50 = 0 and x > 0 then + begin + buf := tostring(x); + page.BeginText(); + page.MoveTextPos(x, 5); + page.ShowText(buf); + page.EndText(); + + page.BeginText(); + page.MoveTextPos(x, height - 10); + page.ShowText(buf); + page.EndText(); + end + + x += 5; + end + + page.SetGrayFill(0); + page.SetGrayStroke(0); +End; diff --git a/demo/ttfont/PenguinAttack.ttf b/demo/ttfont/PenguinAttack.ttf new file mode 100644 index 0000000..622ae2d Binary files /dev/null and b/demo/ttfont/PenguinAttack.ttf differ diff --git a/demo/ttfont/simhei.ttf b/demo/ttfont/simhei.ttf new file mode 100644 index 0000000..5bd4687 Binary files /dev/null and b/demo/ttfont/simhei.ttf differ diff --git a/demo/ttfont/siyuanzhenheiti.ttf b/demo/ttfont/siyuanzhenheiti.ttf new file mode 100644 index 0000000..dc68e05 Binary files /dev/null and b/demo/ttfont/siyuanzhenheiti.ttf differ diff --git a/demo/ttfont_demo.pdf b/demo/ttfont_demo.pdf new file mode 100644 index 0000000..8300ad6 Binary files /dev/null and b/demo/ttfont_demo.pdf differ diff --git a/demo/ttfont_demo.tsl b/demo/ttfont_demo.tsl new file mode 100644 index 0000000..36044d2 --- /dev/null +++ b/demo/ttfont_demo.tsl @@ -0,0 +1,91 @@ +Uses TSPdfEnumerations; +{$IFDEF LINUX} + separator := "/"; +{$ELSE} + separator := "\\"; +{$ENDIF} + +alias := ""; +path := ""; +InitCmdParams(alias, path); +output_file := "ttfont_demo.pdf"; +output_file := path + separator + output_file; + +SAMP_TXT := "这是中文"; + +pdf := new PdfFile(); + +// declaration for using Chinese encoding. +pdf.UseUTFEncodings(); +pdf.SetCompressionMode(TSPdfEnumerations.COMP_ALL); + +// load ttc file +ttf_file := path + separator + "ttfont" + separator + "simhei.ttf"; +detail_font_name := pdf.LoadTTFontFromFile(alias, ttf_file, true); + +// add a new page object. +page := pdf.AddPage(); + +title_font := pdf.GetFont("Helvetica", ""); + +detail_font := pdf.GetFont(detail_font_name, "UTF-8"); + +page.SetFontAndSize(title_font, 10); +page.BeginText(); + +// move the position of the text to top of the page. +page.MoveTextPos(10, 190); +page.ShowText(detail_font_name); +page.ShowText("("); +encoding_name := detail_font.GetEncodingName(); +page.ShowText(encoding_name); +page.ShowText(")"); + +page.SetFontAndSize(detail_font, 15); +page.MoveTextPos(10, -20); +page.ShowText("abcdefghijklmnopqrstuvwxyz"); +page.MoveTextPos(0, -20); +page.ShowText("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); +page.MoveTextPos(0, -20); +page.ShowText("1234567890"); +page.MoveTextPos(0, -20); + +page.SetFontAndSize(detail_font, 10); +page.ShowText(SAMP_TXT); +page.MoveTextPos(0, -18); + +page.SetFontAndSize(detail_font, 16); +page.ShowText(SAMP_TXT); +page.MoveTextPos(0, -27); + +page.SetFontAndSize(detail_font, 23); +page.ShowText(SAMP_TXT); +page.MoveTextPos(0, -36); + +page.SetFontAndSize(detail_font, 30); +page.ShowText(SAMP_TXT); +page.MoveTextPos(0, -36); + +pw := page.TextWidth(SAMP_TXT); +page_height := 210; +page_width := pw + 40; + +page.SetWidth(page_width); +page.SetHeight(page_height); + +// finish to print text. +page.EndText(); + +page.SetLineWidth(0.5); + +page.MoveTo(10, page_height - 25); +page.LineTo(page_width - 10, page_height - 25); +page.Stroke(); + +page.MoveTo(10, page_height - 85); +page.LineTo(page_width - 10, page_height - 85); +page.Stroke(); + +err := pdf.SaveToFile(alias, output_file); +echo "SaveToFile::\t", "err := ", format("%x", err), "\toutput_file := ", output_file, "\n"; +return; diff --git a/demo/type1/COPYING b/demo/type1/COPYING new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/demo/type1/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/demo/type1/README b/demo/type1/README new file mode 100644 index 0000000..3034988 --- /dev/null +++ b/demo/type1/README @@ -0,0 +1,54 @@ +This is release 1.0.7pre22 of Valek Filippov's improved versions of the URW +type 1 font collection, repackaged for distribution with Ghostscript. + +Cyrillized free URW fonts. + +These fonts were made from the free URW fonts distributed with ghostscript. +There are NO changes in the latin part of them (I hope). +Cyrillic glyphs were added by copying suitable latin ones +and painting oulines of unique cyrillic glyphs in same style as the others. +For all modification pfaedit was used. +The license for result is (of course) same as for original fonts, +i.e. GPL with an exception that you can put these fonts in your own non-GPLed +documents. (Looks like LGPL from my point of view =). + +The "sources" of these fonts in the native pfaedit format are available +at ftp://ftp.gnome.ru/fonts/sources + +The great font editor pfaedit is available at http://pfaedit.sf.net. +That page also includes some links to fonts created by +George Williams -- the author of pfaedit. + +Acknowledgements: +I would like to thank George Williams, the pfaedit's author and developer. +He is the most bug-reporter/feature-requester friendly developer +I ever saw in my not so short life. At some moment in the future +I must write a book about him: "George Williams and my best experience +in bug-reporting." George also greatly helped me bug-hunting these fonts, +explained to me some very important things about fonts and font design, +quickly adopted pfaedit to my needs (or pointed me to The Right Place in +documentation where I found better way of doing things). + +I would like to thank Alexey Novodvorsky (aka AEN), who +pointed me to pfaedit and George Williams' fonts, explained +The Task to me. He is also one of the main participators in the +development of Sysiphus -- free repository of free software. +I didn't loose my time for compiling/installing and supporting +my linux box coz I used the result of Sysiphus developers' works. + +I would like to thank Sergey Vlasov, who tested these fonts and reported +about bugs. Also he help me to make some bug-reports to George about +pfaedit bugs. + +I would like Dmitry 40in, who did big QA for some font outlines, drawn some glyphs, +and explain some The Truths for me. + +I would like to thank Vlad Harchev (aka hvv), who +proofread this text for me. + +Also I have to thank RMS for GPL and URW for releasing the fonts +under it. + +Thank you very much! +Valek Filippov frob@df.ru +(C)opyLeft 2001 diff --git a/demo/type1/a010013l.afm b/demo/type1/a010013l.afm new file mode 100644 index 0000000..dd4d2c2 --- /dev/null +++ b/demo/type1/a010013l.afm @@ -0,0 +1,1569 @@ +StartFontMetrics 2.0 +Comment Generated by pfaedit +Comment Creation Date: Thu Dec 26 23:03:13 2002 +FontName URWGothicL-Book +FullName URW Gothic L Book +FamilyName URW Gothic L +Weight Book +Notice (Copyright (URW)++,Copyright 1999 by (URW)++ Design & Development; Cyrillic glyphs added by Valek Filippov (C) 2001-2002) +ItalicAngle 0 +IsFixedPitch false +UnderlinePosition -96 +UnderlineThickness 58 +Version 1.06 +EncodingScheme AdobeStandardEncoding +FontBBox -115 -240 1151 1009 +CapHeight 739 +XHeight 547 +Ascender 739 +Descender -192 +StartCharMetrics 560 +C 0 ; WX 277 ; N .notdef ; B 0 0 0 0 ; +C 32 ; WX 277 ; N space ; B 0 0 0 0 ; +C 33 ; WX 295 ; N exclam ; B 111 0 185 739 ; +C 34 ; WX 309 ; N quotedbl ; B 74 513 237 739 ; +C 35 ; WX 554 ; N numbersign ; B 5 0 549 739 ; +C 36 ; WX 554 ; N dollar ; B 74 -56 479 810 ; +C 37 ; WX 775 ; N percent ; B 13 -13 752 749 ; +C 38 ; WX 757 ; N ampersand ; B 57 -13 735 752 ; +C 39 ; WX 351 ; N quoteright ; B 91 547 253 739 ; +C 40 ; WX 369 ; N parenleft ; B 57 -125 335 739 ; +C 41 ; WX 369 ; N parenright ; B 34 -125 312 739 ; +C 42 ; WX 425 ; N asterisk ; B 64 468 360 752 ; +C 43 ; WX 606 ; N plus ; B 51 49 555 557 ; +C 44 ; WX 277 ; N comma ; B 91 -67 253 126 ; +C 45 ; WX 332 ; N hyphen ; B 31 233 302 296 ; +C 46 ; WX 277 ; N period ; B 101 0 175 126 ; +C 47 ; WX 437 ; N slash ; B 40 -128 397 739 ; +C 48 ; WX 554 ; N zero ; B 30 -13 525 752 ; +C 49 ; WX 554 ; N one ; B 155 0 354 739 ; +C 50 ; WX 554 ; N two ; B 33 0 506 752 ; +C 51 ; WX 554 ; N three ; B 33 -13 504 752 ; +C 52 ; WX 554 ; N four ; B 12 0 527 739 ; +C 53 ; WX 554 ; N five ; B 26 -13 528 739 ; +C 54 ; WX 554 ; N six ; B 25 -13 529 739 ; +C 55 ; WX 554 ; N seven ; B 64 0 490 739 ; +C 56 ; WX 554 ; N eight ; B 42 -13 512 752 ; +C 57 ; WX 554 ; N nine ; B 25 0 529 752 ; +C 58 ; WX 277 ; N colon ; B 101 0 175 507 ; +C 59 ; WX 277 ; N semicolon ; B 41 -67 203 507 ; +C 60 ; WX 606 ; N less ; B 49 37 558 565 ; +C 61 ; WX 606 ; N equal ; B 51 164 555 436 ; +C 62 ; WX 606 ; N greater ; B 48 37 557 565 ; +C 63 ; WX 591 ; N question ; B 65 0 525 752 ; +C 64 ; WX 867 ; N at ; B 71 -13 797 752 ; +C 65 ; WX 740 ; N A ; B 11 0 729 739 ; +C 66 ; WX 574 ; N B ; B 76 0 544 739 ; +C 67 ; WX 813 ; N C ; B 44 -13 770 752 ; +C 68 ; WX 744 ; N D ; B 76 0 700 739 ; +C 69 ; WX 536 ; N E ; B 76 0 480 739 ; +C 70 ; WX 485 ; N F ; B 76 0 451 739 ; +C 71 ; WX 872 ; N G ; B 44 -13 831 752 ; +C 72 ; WX 683 ; N H ; B 76 0 607 739 ; +C 73 ; WX 226 ; N I ; B 76 0 150 739 ; L J IJ ; +C 74 ; WX 482 ; N J ; B 11 -14 406 739 ; +C 75 ; WX 591 ; N K ; B 76 0 585 739 ; +C 76 ; WX 462 ; N L ; B 76 0 456 739 ; +C 77 ; WX 919 ; N M ; B 76 0 843 739 ; +C 78 ; WX 740 ; N N ; B 76 0 664 739 ; +C 79 ; WX 869 ; N O ; B 44 -13 825 752 ; +C 80 ; WX 592 ; N P ; B 76 0 565 739 ; +C 81 ; WX 871 ; N Q ; B 44 -13 839 752 ; +C 82 ; WX 607 ; N R ; B 76 0 577 739 ; +C 83 ; WX 498 ; N S ; B 22 -13 476 752 ; +C 84 ; WX 426 ; N T ; B 7 0 419 739 ; +C 85 ; WX 655 ; N U ; B 76 -13 579 739 ; +C 86 ; WX 702 ; N V ; B 10 0 692 739 ; +C 87 ; WX 960 ; N W ; B 10 0 950 739 ; +C 88 ; WX 609 ; N X ; B 8 0 601 739 ; +C 89 ; WX 592 ; N Y ; B 2 0 590 739 ; +C 90 ; WX 480 ; N Z ; B 17 0 474 739 ; +C 91 ; WX 351 ; N bracketleft ; B 112 -125 313 739 ; +C 92 ; WX 605 ; N backslash ; B 84 0 464 739 ; +C 93 ; WX 351 ; N bracketright ; B 38 -125 239 739 ; +C 94 ; WX 606 ; N asciicircum ; B 18 180 588 739 ; +C 95 ; WX 500 ; N underscore ; B 0 -125 500 -67 ; +C 96 ; WX 351 ; N quoteleft ; B 98 547 260 739 ; +C 97 ; WX 683 ; N a ; B 42 -13 620 560 ; +C 98 ; WX 682 ; N b ; B 63 -13 640 739 ; +C 99 ; WX 647 ; N c ; B 42 -13 608 560 ; +C 100 ; WX 685 ; N d ; B 42 -13 622 739 ; +C 101 ; WX 650 ; N e ; B 42 -13 611 560 ; +C 102 ; WX 314 ; N f ; B 16 0 311 739 ; L l fl ; L i fi ; +C 103 ; WX 673 ; N g ; B 42 -215 610 560 ; +C 104 ; WX 610 ; N h ; B 63 0 547 739 ; +C 105 ; WX 200 ; N i ; B 63 0 137 739 ; L j ij ; +C 106 ; WX 203 ; N j ; B -45 -192 140 739 ; +C 107 ; WX 502 ; N k ; B 63 0 497 739 ; +C 108 ; WX 200 ; N l ; B 63 0 137 739 ; +C 109 ; WX 938 ; N m ; B 63 0 875 561 ; +C 110 ; WX 610 ; N n ; B 63 0 547 560 ; +C 111 ; WX 655 ; N o ; B 42 -13 613 560 ; +C 112 ; WX 682 ; N p ; B 63 -192 640 560 ; +C 113 ; WX 682 ; N q ; B 42 -192 619 560 ; +C 114 ; WX 301 ; N r ; B 63 0 292 560 ; +C 115 ; WX 388 ; N s ; B 18 -13 361 560 ; +C 116 ; WX 339 ; N t ; B 12 0 327 739 ; +C 117 ; WX 608 ; N u ; B 63 -13 545 547 ; +C 118 ; WX 554 ; N v ; B 8 0 546 547 ; +C 119 ; WX 831 ; N w ; B 7 0 824 547 ; +C 120 ; WX 480 ; N x ; B 8 0 472 547 ; +C 121 ; WX 536 ; N y ; B 9 -192 527 547 ; +C 122 ; WX 425 ; N z ; B 10 0 415 547 ; +C 123 ; WX 351 ; N braceleft ; B 37 -126 271 739 ; +C 124 ; WX 672 ; N bar ; B 304 0 368 739 ; +C 125 ; WX 351 ; N braceright ; B 38 -126 269 739 ; +C 126 ; WX 606 ; N asciitilde ; B 51 210 555 390 ; +C 161 ; WX 295 ; N exclamdown ; B 111 -192 185 547 ; +C 162 ; WX 554 ; N cent ; B 45 62 509 707 ; +C 163 ; WX 554 ; N sterling ; B 18 0 592 752 ; +C 164 ; WX 166 ; N fraction ; B -115 0 281 739 ; +C 165 ; WX 554 ; N yen ; B 0 0 589 739 ; +C 166 ; WX 554 ; N florin ; B 18 -153 546 818 ; +C 167 ; WX 615 ; N section ; B 87 -141 529 752 ; +C 168 ; WX 554 ; N currency ; B 26 50 528 553 ; +C 169 ; WX 198 ; N quotesingle ; B 74 513 124 739 ; +C 170 ; WX 502 ; N quotedblleft ; B 96 547 406 739 ; +C 171 ; WX 425 ; N guillemotleft ; B 40 99 385 499 ; +C 172 ; WX 251 ; N guilsinglleft ; B 40 99 211 499 ; +C 173 ; WX 251 ; N guilsinglright ; B 40 99 211 499 ; +C 174 ; WX 487 ; N fi ; B 13 0 424 739 ; +C 175 ; WX 485 ; N fl ; B 13 0 422 739 ; +C 177 ; WX 500 ; N endash ; B 0 233 500 296 ; +C 178 ; WX 553 ; N dagger ; B 59 -133 494 739 ; +C 179 ; WX 553 ; N daggerdbl ; B 59 -133 494 739 ; +C 180 ; WX 277 ; N periodcentered ; B 101 229 175 355 ; +C 182 ; WX 564 ; N paragraph ; B 37 -133 491 739 ; +C 183 ; WX 606 ; N bullet ; B 118 118 488 488 ; +C 184 ; WX 354 ; N quotesinglbase ; B 89 -67 251 126 ; +C 185 ; WX 502 ; N quotedblbase ; B 89 -67 398 126 ; +C 186 ; WX 484 ; N quotedblright ; B 87 547 393 739 ; +C 187 ; WX 425 ; N guillemotright ; B 40 99 385 499 ; +C 188 ; WX 1000 ; N ellipsis ; B 130 0 870 126 ; +C 189 ; WX 1174 ; N perthousand ; B 13 -13 1151 749 ; +C 191 ; WX 591 ; N questiondown ; B 66 -205 526 547 ; +C 193 ; WX 378 ; N grave ; B 74 610 304 776 ; +C 194 ; WX 375 ; N acute ; B 74 610 301 782 ; +C 195 ; WX 502 ; N circumflex ; B 74 623 428 749 ; +C 196 ; WX 439 ; N tilde ; B 75 633 365 728 ; +C 197 ; WX 485 ; N macron ; B 74 643 411 707 ; +C 198 ; WX 453 ; N breve ; B 74 623 378 743 ; +C 199 ; WX 222 ; N dotaccent ; B 74 623 148 749 ; +C 200 ; WX 369 ; N dieresis ; B 74 623 295 749 ; +C 202 ; WX 332 ; N ring ; B 74 610 258 794 ; +C 203 ; WX 324 ; N cedilla ; B 74 -213 250 0 ; +C 205 ; WX 552 ; N hungarumlaut ; B 74 610 479 780 ; +C 206 ; WX 302 ; N ogonek ; B 74 -191 228 0 ; +C 207 ; WX 502 ; N caron ; B 74 623 428 749 ; +C 208 ; WX 1000 ; N emdash ; B 0 233 1000 296 ; +C 225 ; WX 992 ; N AE ; B 11 0 936 739 ; +C 227 ; WX 369 ; N ordfeminine ; B 31 319 339 745 ; +C 232 ; WX 517 ; N Lslash ; B 26 0 502 739 ; +C 233 ; WX 868 ; N Oslash ; B 44 -83 824 821 ; +C 234 ; WX 1194 ; N OE ; B 44 -13 1138 752 ; +C 235 ; WX 369 ; N ordmasculine ; B 32 319 337 745 ; +C 241 ; WX 1157 ; N ae ; B 42 -13 1118 560 ; +C 245 ; WX 200 ; N dotlessi ; B 63 0 137 547 ; +C 248 ; WX 300 ; N lslash ; B 36 0 270 739 ; +C 249 ; WX 653 ; N oslash ; B 42 -39 611 594 ; +C 250 ; WX 1137 ; N oe ; B 42 -13 1098 560 ; +C 251 ; WX 554 ; N germandbls ; B 59 -13 524 752 ; +C -1 ; WX 740 ; N Adieresis ; B 11 0 729 931 ; +C -1 ; WX 740 ; N Aacute ; B 11 0 729 964 ; +C -1 ; WX 740 ; N Agrave ; B 11 0 729 958 ; +C -1 ; WX 740 ; N Acircumflex ; B 11 0 729 931 ; +C -1 ; WX 740 ; N Abreve ; B 11 0 729 925 ; +C -1 ; WX 740 ; N Atilde ; B 11 0 729 910 ; +C -1 ; WX 740 ; N Aring ; B 11 0 729 976 ; +C -1 ; WX 740 ; N Aogonek ; B 11 -191 760 739 ; +C -1 ; WX 813 ; N Ccedilla ; B 44 -240 770 752 ; +C -1 ; WX 813 ; N Cacute ; B 44 -13 770 964 ; +C -1 ; WX 813 ; N Ccaron ; B 44 -13 770 931 ; +C -1 ; WX 744 ; N Dcaron ; B 76 0 700 931 ; +C -1 ; WX 536 ; N Edieresis ; B 76 0 480 931 ; +C -1 ; WX 536 ; N Eacute ; B 76 0 480 964 ; +C -1 ; WX 536 ; N Egrave ; B 76 0 480 958 ; +C -1 ; WX 536 ; N Ecircumflex ; B 76 0 480 931 ; +C -1 ; WX 536 ; N Ecaron ; B 76 0 480 931 ; +C -1 ; WX 536 ; N Edotaccent ; B 76 0 480 931 ; +C -1 ; WX 536 ; N Eogonek ; B 76 -191 511 739 ; +C -1 ; WX 872 ; N Gbreve ; B 44 -13 831 925 ; +C -1 ; WX 226 ; N Idieresis ; B 3 0 224 931 ; +C -1 ; WX 226 ; N Iacute ; B -1 0 226 964 ; +C -1 ; WX 226 ; N Igrave ; B -2 0 228 958 ; +C -1 ; WX 226 ; N Icircumflex ; B -64 0 290 931 ; +C -1 ; WX 226 ; N Idotaccent ; B 76 0 150 931 ; +C -1 ; WX 462 ; N Lacute ; B 76 0 456 964 ; +C -1 ; WX 462 ; N Lcaron ; B 76 0 456 739 ; +C -1 ; WX 740 ; N Nacute ; B 76 0 664 964 ; +C -1 ; WX 740 ; N Ncaron ; B 76 0 664 931 ; +C -1 ; WX 740 ; N Ntilde ; B 76 0 664 910 ; +C -1 ; WX 869 ; N Odieresis ; B 44 -13 825 931 ; +C -1 ; WX 869 ; N Oacute ; B 44 -13 825 964 ; +C -1 ; WX 869 ; N Ograve ; B 44 -13 825 958 ; +C -1 ; WX 869 ; N Ocircumflex ; B 44 -13 825 931 ; +C -1 ; WX 869 ; N Otilde ; B 44 -13 825 910 ; +C -1 ; WX 869 ; N Ohungarumlaut ; B 44 -13 825 962 ; +C -1 ; WX 607 ; N Racute ; B 76 0 577 964 ; +C -1 ; WX 607 ; N Rcaron ; B 76 0 577 931 ; +C -1 ; WX 498 ; N Sacute ; B 22 -13 476 964 ; +C -1 ; WX 498 ; N Scaron ; B 22 -13 476 931 ; +C -1 ; WX 498 ; N Scedilla ; B 22 -213 476 752 ; +C -1 ; WX 426 ; N Tcaron ; B 7 0 419 931 ; +C -1 ; WX 655 ; N Udieresis ; B 76 -13 579 931 ; +C -1 ; WX 655 ; N Uacute ; B 76 -13 579 964 ; +C -1 ; WX 655 ; N Ugrave ; B 76 -13 579 958 ; +C -1 ; WX 655 ; N Ucircumflex ; B 76 -13 579 931 ; +C -1 ; WX 655 ; N Uring ; B 76 -13 579 976 ; +C -1 ; WX 655 ; N Uhungarumlaut ; B 76 -13 579 962 ; +C -1 ; WX 592 ; N Yacute ; B 2 0 590 964 ; +C -1 ; WX 480 ; N Zacute ; B 17 0 474 964 ; +C -1 ; WX 480 ; N Zcaron ; B 17 0 474 931 ; +C -1 ; WX 480 ; N Zdotaccent ; B 17 0 474 931 ; +C -1 ; WX 740 ; N Amacron ; B 11 0 729 889 ; +C -1 ; WX 426 ; N Tcommaaccent ; B 7 -225 419 739 ; +C -1 ; WX 592 ; N Ydieresis ; B 2 0 590 931 ; +C -1 ; WX 536 ; N Emacron ; B 76 0 480 889 ; +C -1 ; WX 226 ; N Imacron ; B -56 0 281 889 ; +C -1 ; WX 226 ; N Iogonek ; B 27 -191 181 739 ; +C -1 ; WX 591 ; N Kcommaaccent ; B 76 -225 585 739 ; +C -1 ; WX 462 ; N Lcommaaccent ; B 76 -225 456 739 ; +C -1 ; WX 740 ; N Ncommaaccent ; B 76 -225 664 739 ; +C -1 ; WX 869 ; N Omacron ; B 44 -13 825 889 ; +C -1 ; WX 607 ; N Rcommaaccent ; B 76 -225 577 739 ; +C -1 ; WX 872 ; N Gcommaaccent ; B 44 -225 831 752 ; +C -1 ; WX 655 ; N Umacron ; B 76 -13 579 889 ; +C -1 ; WX 655 ; N Uogonek ; B 76 -191 579 739 ; +C -1 ; WX 683 ; N adieresis ; B 42 -13 620 749 ; +C -1 ; WX 683 ; N aacute ; B 42 -13 620 782 ; +C -1 ; WX 683 ; N agrave ; B 42 -13 620 776 ; +C -1 ; WX 683 ; N acircumflex ; B 42 -13 620 749 ; +C -1 ; WX 683 ; N abreve ; B 42 -13 620 743 ; +C -1 ; WX 683 ; N atilde ; B 42 -13 620 728 ; +C -1 ; WX 683 ; N aring ; B 42 -13 620 794 ; +C -1 ; WX 683 ; N aogonek ; B 42 -191 651 560 ; +C -1 ; WX 647 ; N cacute ; B 42 -13 608 782 ; +C -1 ; WX 647 ; N ccaron ; B 42 -13 608 749 ; +C -1 ; WX 647 ; N ccedilla ; B 42 -224 608 560 ; +C -1 ; WX 725 ; N dcaron ; B 42 -13 765 739 ; +C -1 ; WX 650 ; N edieresis ; B 42 -13 611 749 ; +C -1 ; WX 650 ; N eacute ; B 42 -13 611 782 ; +C -1 ; WX 650 ; N egrave ; B 42 -13 611 776 ; +C -1 ; WX 650 ; N ecircumflex ; B 42 -13 611 749 ; +C -1 ; WX 650 ; N ecaron ; B 42 -13 611 749 ; +C -1 ; WX 650 ; N edotaccent ; B 42 -13 611 749 ; +C -1 ; WX 650 ; N eogonek ; B 42 -191 611 560 ; +C -1 ; WX 673 ; N gbreve ; B 42 -215 610 743 ; +C -1 ; WX 200 ; N idieresis ; B -10 0 211 749 ; +C -1 ; WX 200 ; N iacute ; B -13 0 214 782 ; +C -1 ; WX 200 ; N igrave ; B -15 0 215 776 ; +C -1 ; WX 200 ; N icircumflex ; B -77 0 277 749 ; +C -1 ; WX 200 ; N lacute ; B -14 0 213 964 ; +C -1 ; WX 245 ; N lcaron ; B 63 0 285 739 ; +C -1 ; WX 610 ; N nacute ; B 63 0 547 782 ; +C -1 ; WX 610 ; N ncaron ; B 63 0 547 749 ; +C -1 ; WX 610 ; N ntilde ; B 63 0 547 728 ; +C -1 ; WX 655 ; N odieresis ; B 42 -13 613 749 ; +C -1 ; WX 655 ; N oacute ; B 42 -13 613 782 ; +C -1 ; WX 655 ; N ograve ; B 42 -13 613 776 ; +C -1 ; WX 655 ; N ocircumflex ; B 42 -13 613 749 ; +C -1 ; WX 655 ; N otilde ; B 42 -13 613 728 ; +C -1 ; WX 655 ; N ohungarumlaut ; B 42 -13 613 780 ; +C -1 ; WX 301 ; N racute ; B 63 0 324 782 ; +C -1 ; WX 388 ; N sacute ; B 18 -13 361 782 ; +C -1 ; WX 388 ; N scaron ; B 17 -13 371 749 ; +C -1 ; WX 388 ; N scommaaccent ; B 18 -225 361 560 ; +C -1 ; WX 339 ; N tcaron ; B 12 0 379 739 ; +C -1 ; WX 608 ; N udieresis ; B 63 -13 545 749 ; +C -1 ; WX 608 ; N uacute ; B 63 -13 545 782 ; +C -1 ; WX 608 ; N ugrave ; B 63 -13 545 776 ; +C -1 ; WX 608 ; N ucircumflex ; B 63 -13 545 749 ; +C -1 ; WX 608 ; N uring ; B 63 -13 545 794 ; +C -1 ; WX 608 ; N uhungarumlaut ; B 63 -13 547 780 ; +C -1 ; WX 536 ; N yacute ; B 9 -192 527 782 ; +C -1 ; WX 425 ; N zacute ; B 10 0 415 782 ; +C -1 ; WX 425 ; N zcaron ; B 10 0 415 749 ; +C -1 ; WX 425 ; N zdotaccent ; B 10 0 415 749 ; +C -1 ; WX 536 ; N ydieresis ; B 9 -192 527 749 ; +C -1 ; WX 339 ; N tcommaaccent ; B 12 -225 327 739 ; +C -1 ; WX 683 ; N amacron ; B 42 -13 620 707 ; +C -1 ; WX 650 ; N emacron ; B 42 -13 611 707 ; +C -1 ; WX 200 ; N imacron ; B -69 0 268 707 ; +C -1 ; WX 502 ; N kcommaaccent ; B 63 -225 497 739 ; +C -1 ; WX 200 ; N lcommaaccent ; B 26 -225 148 739 ; +C -1 ; WX 610 ; N ncommaaccent ; B 63 -225 547 560 ; +C -1 ; WX 655 ; N omacron ; B 42 -13 613 707 ; +C -1 ; WX 301 ; N rcommaaccent ; B 63 -225 292 560 ; +C -1 ; WX 608 ; N umacron ; B 63 -13 545 707 ; +C -1 ; WX 608 ; N uogonek ; B 63 -191 576 547 ; +C -1 ; WX 301 ; N rcaron ; B 10 0 364 749 ; +C -1 ; WX 388 ; N scedilla ; B 17 -213 361 560 ; +C -1 ; WX 673 ; N gcommaaccent ; B 42 -215 610 790 ; +C -1 ; WX 200 ; N iogonek ; B 14 -191 168 739 ; +C -1 ; WX 498 ; N Scommaaccent ; B 22 -225 476 752 ; +C -1 ; WX 790 ; N Eth ; B 26 0 746 739 ; +C -1 ; WX 790 ; N Dcroat ; B 26 0 746 739 ; +C -1 ; WX 592 ; N Thorn ; B 76 0 565 739 ; +C -1 ; WX 685 ; N dcroat ; B 42 -13 685 739 ; +C -1 ; WX 655 ; N eth ; B 42 -13 613 756 ; +C -1 ; WX 682 ; N thorn ; B 63 -192 640 739 ; +C -1 ; WX 554 ; N Euro ; B -32 -13 573 752 ; +C -1 ; WX 332 ; N onesuperior ; B 98 288 233 739 ; +C -1 ; WX 332 ; N twosuperior ; B 12 288 320 747 ; +C -1 ; WX 332 ; N threesuperior ; B 13 280 319 747 ; +C -1 ; WX 400 ; N degree ; B 50 380 350 686 ; +C -1 ; WX 606 ; N minus ; B 51 267 555 341 ; +C -1 ; WX 606 ; N multiply ; B 51 48 555 551 ; +C -1 ; WX 606 ; N divide ; B 51 112 555 496 ; +C -1 ; WX 1000 ; N trademark ; B 63 340 938 739 ; +C -1 ; WX 606 ; N plusminus ; B 51 0 555 585 ; +C -1 ; WX 831 ; N onehalf ; B 96 0 814 739 ; +C -1 ; WX 831 ; N onequarter ; B 101 0 803 739 ; +C -1 ; WX 831 ; N threequarters ; B 13 0 803 747 ; +C -1 ; WX 351 ; N commaaccent ; B 101 -225 223 -53 ; +C -1 ; WX 747 ; N copyright ; B -9 -13 755 752 ; +C -1 ; WX 747 ; N registered ; B -9 -13 755 752 ; +C -1 ; WX 494 ; N lozenge ; B 18 0 466 740 ; +C -1 ; WX 612 ; N uni2206 ; B 6 0 608 688 ; +C -1 ; WX 549 ; N notequal ; B 25 42 529 558 ; +C -1 ; WX 549 ; N radical ; B 10 -35 515 913 ; +C -1 ; WX 549 ; N lessequal ; B 26 0 530 646 ; +C -1 ; WX 549 ; N greaterequal ; B 26 0 530 646 ; +C -1 ; WX 606 ; N logicalnot ; B 51 148 555 436 ; +C -1 ; WX 713 ; N summation ; B 14 -123 695 752 ; +C -1 ; WX 494 ; N partialdiff ; B 26 -10 462 753 ; +C -1 ; WX 672 ; N brokenbar ; B 304 0 368 739 ; +C -1 ; WX 608 ; N mu ; B 63 -192 545 547 ; +C -1 ; WX 740 ; N afii10017 ; B 11 0 729 739 ; +C -1 ; WX 571 ; N afii10018 ; B 76 0 544 739 ; +C -1 ; WX 571 ; N afii10019 ; B 76 0 544 739 ; +C -1 ; WX 487 ; N afii10020 ; B 76 0 480 739 ; +C -1 ; WX 848 ; N afii10021 ; B 66 -126 781 739 ; +C -1 ; WX 536 ; N afii10022 ; B 76 0 480 739 ; +C -1 ; WX 536 ; N afii10023 ; B 76 0 480 924 ; +C -1 ; WX 974 ; N afii10024 ; B 45 0 934 739 ; +C -1 ; WX 665 ; N afii10025 ; B 58 -13 622 752 ; +C -1 ; WX 663 ; N afii10026 ; B 76 0 587 739 ; +C -1 ; WX 663 ; N afii10027 ; B 76 0 587 919 ; +C -1 ; WX 591 ; N afii10028 ; B 76 0 570 739 ; +C -1 ; WX 702 ; N afii10029 ; B 35 0 665 739 ; +C -1 ; WX 919 ; N afii10030 ; B 106 0 813 739 ; +C -1 ; WX 683 ; N afii10031 ; B 76 0 607 739 ; +C -1 ; WX 869 ; N afii10032 ; B 44 -13 825 752 ; +C -1 ; WX 683 ; N afii10033 ; B 76 0 607 739 ; +C -1 ; WX 592 ; N afii10034 ; B 76 0 565 739 ; +C -1 ; WX 813 ; N afii10035 ; B 44 -13 770 752 ; +C -1 ; WX 466 ; N afii10036 ; B 7 0 459 739 ; +C -1 ; WX 596 ; N afii10037 ; B 4 0 592 739 ; +C -1 ; WX 825 ; N afii10038 ; B 47 -42 785 794 ; +C -1 ; WX 609 ; N afii10039 ; B 8 0 601 739 ; +C -1 ; WX 712 ; N afii10040 ; B 76 -140 668 739 ; +C -1 ; WX 635 ; N afii10041 ; B 66 0 559 741 ; +C -1 ; WX 964 ; N afii10042 ; B 76 0 888 739 ; +C -1 ; WX 983 ; N afii10043 ; B 76 -140 949 739 ; +C -1 ; WX 710 ; N afii10044 ; B 6 0 683 739 ; +C -1 ; WX 742 ; N afii10045 ; B 76 0 666 739 ; +C -1 ; WX 571 ; N afii10046 ; B 76 0 544 739 ; +C -1 ; WX 814 ; N afii10047 ; B 44 -13 770 752 ; +C -1 ; WX 1081 ; N afii10048 ; B 76 -13 1037 752 ; +C -1 ; WX 604 ; N afii10049 ; B 27 0 528 739 ; +C -1 ; WX 683 ; N afii10065 ; B 42 -13 620 560 ; +C -1 ; WX 656 ; N afii10066 ; B 45 -13 618 784 ; +C -1 ; WX 473 ; N afii10067 ; B 63 0 439 547 ; +C -1 ; WX 369 ; N afii10068 ; B 63 0 364 547 ; +C -1 ; WX 668 ; N afii10069 ; B 27 -120 641 547 ; +C -1 ; WX 650 ; N afii10070 ; B 42 -13 611 560 ; +C -1 ; WX 650 ; N afii10071 ; B 42 -13 611 749 ; +C -1 ; WX 768 ; N afii10072 ; B 7 0 761 548 ; +C -1 ; WX 458 ; N afii10073 ; B 27 -13 431 560 ; +C -1 ; WX 608 ; N afii10074 ; B 63 0 545 548 ; +C -1 ; WX 608 ; N afii10075 ; B 63 0 545 733 ; +C -1 ; WX 477 ; N afii10076 ; B 63 0 467 549 ; +C -1 ; WX 554 ; N afii10077 ; B 8 0 546 547 ; +C -1 ; WX 690 ; N afii10078 ; B 63 0 627 549 ; +C -1 ; WX 544 ; N afii10079 ; B 63 0 481 547 ; +C -1 ; WX 655 ; N afii10080 ; B 42 -13 613 560 ; +C -1 ; WX 549 ; N afii10081 ; B 63 0 486 547 ; +C -1 ; WX 682 ; N afii10082 ; B 63 -192 640 560 ; +C -1 ; WX 647 ; N afii10083 ; B 42 -13 608 560 ; +C -1 ; WX 362 ; N afii10084 ; B 6 0 356 547 ; +C -1 ; WX 536 ; N afii10085 ; B 9 -192 527 547 ; +C -1 ; WX 728 ; N afii10086 ; B 42 -108 686 631 ; +C -1 ; WX 480 ; N afii10087 ; B 8 0 472 547 ; +C -1 ; WX 560 ; N afii10088 ; B 63 -129 533 547 ; +C -1 ; WX 500 ; N afii10089 ; B 34 0 437 547 ; +C -1 ; WX 822 ; N afii10090 ; B 63 0 759 548 ; +C -1 ; WX 882 ; N afii10091 ; B 63 -129 825 547 ; +C -1 ; WX 556 ; N afii10092 ; B 6 0 529 547 ; +C -1 ; WX 620 ; N afii10093 ; B 63 0 567 547 ; +C -1 ; WX 466 ; N afii10094 ; B 63 0 439 547 ; +C -1 ; WX 650 ; N afii10095 ; B 42 -13 608 560 ; +C -1 ; WX 853 ; N afii10096 ; B 63 -13 796 560 ; +C -1 ; WX 502 ; N afii10097 ; B 35 0 439 547 ; +C -1 ; WX 536 ; N uni0400 ; B 76 0 480 958 ; +C -1 ; WX 426 ; N afii10051 ; B 7 0 419 739 ; +C -1 ; WX 487 ; N afii10052 ; B 76 0 480 954 ; +C -1 ; WX 814 ; N afii10053 ; B 44 -13 770 752 ; +C -1 ; WX 498 ; N afii10054 ; B 22 -13 476 752 ; +C -1 ; WX 226 ; N afii10055 ; B 76 0 150 739 ; +C -1 ; WX 226 ; N afii10056 ; B 2 0 223 905 ; +C -1 ; WX 482 ; N afii10057 ; B 11 -14 406 739 ; +C -1 ; WX 906 ; N afii10058 ; B 11 -1 885 739 ; +C -1 ; WX 957 ; N afii10059 ; B 76 0 910 739 ; +C -1 ; WX 426 ; N afii10060 ; B 7 0 419 739 ; +C -1 ; WX 591 ; N afii10061 ; B 76 0 585 954 ; +C -1 ; WX 740 ; N uni040D ; B 76 0 664 1005 ; +C -1 ; WX 596 ; N afii10062 ; B 4 0 592 906 ; +C -1 ; WX 683 ; N afii10145 ; B 76 -140 607 739 ; +C -1 ; WX 650 ; N uni0450 ; B 42 -13 611 813 ; +C -1 ; WX 610 ; N afii10099 ; B 9 0 546 739 ; +C -1 ; WX 369 ; N afii10100 ; B 63 0 364 788 ; +C -1 ; WX 650 ; N afii10101 ; B 42 -13 608 560 ; +C -1 ; WX 388 ; N afii10102 ; B 18 -13 361 560 ; +C -1 ; WX 200 ; N afii10103 ; B 63 0 137 739 ; +C -1 ; WX 200 ; N afii10104 ; B -10 0 211 749 ; +C -1 ; WX 203 ; N afii10105 ; B -45 -192 140 739 ; +C -1 ; WX 678 ; N afii10106 ; B 8 0 652 547 ; +C -1 ; WX 694 ; N afii10107 ; B 63 0 664 547 ; +C -1 ; WX 610 ; N afii10108 ; B 9 0 546 739 ; +C -1 ; WX 502 ; N afii10109 ; B 63 0 497 788 ; +C -1 ; WX 608 ; N uni045D ; B 63 0 545 760 ; +C -1 ; WX 536 ; N afii10110 ; B 9 -192 527 733 ; +C -1 ; WX 529 ; N afii10193 ; B 63 -140 466 547 ; +C -1 ; WX 571 ; N uni048C ; B 4 0 544 739 ; +C -1 ; WX 466 ; N uni048D ; B 3 0 439 547 ; +C -1 ; WX 592 ; N uni048E ; B 76 0 565 739 ; +C -1 ; WX 682 ; N uni048F ; B 63 -192 640 560 ; +C -1 ; WX 487 ; N afii10050 ; B 76 0 480 805 ; +C -1 ; WX 369 ; N afii10098 ; B 63 0 364 610 ; +C -1 ; WX 487 ; N uni0492 ; B 10 0 480 739 ; +C -1 ; WX 369 ; N uni0493 ; B 3 0 364 547 ; +C -1 ; WX 487 ; N uni0494 ; B 76 0 480 739 ; +C -1 ; WX 369 ; N uni0495 ; B 63 0 364 547 ; +C -1 ; WX 974 ; N uni0496 ; B 10 0 964 739 ; +C -1 ; WX 808 ; N uni0497 ; B 7 -129 807 549 ; +C -1 ; WX 559 ; N uni0498 ; B 44 -8 515 752 ; +C -1 ; WX 400 ; N uni0499 ; B 27 -13 373 560 ; +C -1 ; WX 591 ; N uni049A ; B 76 0 585 739 ; +C -1 ; WX 502 ; N uni049B ; B 63 0 497 549 ; +C -1 ; WX 591 ; N uni049C ; B 76 0 585 739 ; +C -1 ; WX 502 ; N uni049D ; B 63 0 497 549 ; +C -1 ; WX 591 ; N uni049E ; B 6 0 585 739 ; +C -1 ; WX 502 ; N uni049F ; B 4 0 497 549 ; +C -1 ; WX 591 ; N uni04A0 ; B 76 0 585 739 ; +C -1 ; WX 502 ; N uni04A1 ; B 63 0 497 549 ; +C -1 ; WX 683 ; N uni04A2 ; B 76 0 607 739 ; +C -1 ; WX 529 ; N uni04A3 ; B 63 0 466 547 ; +C -1 ; WX 844 ; N uni04A4 ; B 76 0 819 739 ; +C -1 ; WX 529 ; N uni04A5 ; B 63 0 466 547 ; +C -1 ; WX 683 ; N uni04A6 ; B 76 0 607 739 ; +C -1 ; WX 529 ; N uni04A7 ; B 63 0 466 547 ; +C -1 ; WX 813 ; N uni04A8 ; B 44 -13 770 752 ; +C -1 ; WX 647 ; N uni04A9 ; B 42 -13 608 560 ; +C -1 ; WX 813 ; N uni04AA ; B 44 -13 770 752 ; +C -1 ; WX 647 ; N uni04AB ; B 42 -13 608 560 ; +C -1 ; WX 426 ; N uni04AC ; B 7 0 419 739 ; +C -1 ; WX 362 ; N uni04AD ; B 6 0 356 547 ; +C -1 ; WX 592 ; N uni04AE ; B 2 0 590 739 ; +C -1 ; WX 554 ; N uni04AF ; B 8 -192 546 547 ; +C -1 ; WX 592 ; N uni04B0 ; B 2 0 590 739 ; +C -1 ; WX 554 ; N uni04B1 ; B 8 -192 546 547 ; +C -1 ; WX 609 ; N uni04B2 ; B 8 0 601 739 ; +C -1 ; WX 480 ; N uni04B3 ; B 8 0 472 547 ; +C -1 ; WX 742 ; N uni04B4 ; B 76 -140 698 739 ; +C -1 ; WX 590 ; N uni04B5 ; B 63 -129 563 547 ; +C -1 ; WX 635 ; N uni04B6 ; B 66 0 559 741 ; +C -1 ; WX 500 ; N uni04B7 ; B 34 0 437 547 ; +C -1 ; WX 635 ; N uni04B8 ; B 66 1 559 742 ; +C -1 ; WX 500 ; N uni04B9 ; B 34 1 437 548 ; +C -1 ; WX 635 ; N uni04BA ; B 66 0 559 741 ; +C -1 ; WX 500 ; N uni04BB ; B 34 0 437 547 ; +C -1 ; WX 813 ; N uni04BC ; B 44 -13 770 752 ; +C -1 ; WX 647 ; N uni04BD ; B 42 -13 608 560 ; +C -1 ; WX 813 ; N uni04BE ; B 44 -13 770 752 ; +C -1 ; WX 647 ; N uni04BF ; B 42 -13 608 560 ; +C -1 ; WX 226 ; N uni04C0 ; B 76 0 150 739 ; +C -1 ; WX 974 ; N uni04C1 ; B 10 0 964 959 ; +C -1 ; WX 808 ; N uni04C2 ; B 7 0 801 767 ; +C -1 ; WX 591 ; N uni04C3 ; B 76 0 585 739 ; +C -1 ; WX 502 ; N uni04C4 ; B 63 0 497 549 ; +C -1 ; WX 683 ; N uni04C7 ; B 76 0 607 739 ; +C -1 ; WX 529 ; N uni04C8 ; B 63 0 466 547 ; +C -1 ; WX 635 ; N uni04CB ; B 66 0 559 741 ; +C -1 ; WX 500 ; N uni04CC ; B 34 0 437 547 ; +C -1 ; WX 740 ; N uni04D0 ; B 11 0 729 912 ; +C -1 ; WX 683 ; N uni04D1 ; B 42 -13 620 767 ; +C -1 ; WX 740 ; N uni04D2 ; B 11 0 729 918 ; +C -1 ; WX 683 ; N uni04D3 ; B 42 -13 620 773 ; +C -1 ; WX 992 ; N uni04D4 ; B 11 0 936 739 ; +C -1 ; WX 1157 ; N uni04D5 ; B 42 -13 1118 560 ; +C -1 ; WX 536 ; N uni04D6 ; B 76 0 480 912 ; +C -1 ; WX 650 ; N uni04D7 ; B 42 -13 611 767 ; +C -1 ; WX 872 ; N uni04D8 ; B 44 -13 831 752 ; +C -1 ; WX 647 ; N afii10846 ; B 27 -13 608 560 ; +C -1 ; WX 872 ; N uni04DA ; B 44 -13 831 958 ; +C -1 ; WX 647 ; N uni04DB ; B 27 -13 608 766 ; +C -1 ; WX 974 ; N uni04DC ; B 10 0 964 965 ; +C -1 ; WX 808 ; N uni04DD ; B 7 0 801 773 ; +C -1 ; WX 559 ; N uni04DE ; B 44 -8 515 965 ; +C -1 ; WX 400 ; N uni04DF ; B 27 -13 373 773 ; +C -1 ; WX 559 ; N uni04E0 ; B 44 -8 515 752 ; +C -1 ; WX 400 ; N uni04E1 ; B 27 -13 373 560 ; +C -1 ; WX 740 ; N uni04E2 ; B 76 0 664 903 ; +C -1 ; WX 608 ; N uni04E3 ; B 63 0 545 652 ; +C -1 ; WX 740 ; N uni04E4 ; B 76 0 664 965 ; +C -1 ; WX 608 ; N uni04E5 ; B 63 0 545 713 ; +C -1 ; WX 869 ; N uni04E6 ; B 44 -13 825 965 ; +C -1 ; WX 655 ; N uni04E7 ; B 42 -13 613 773 ; +C -1 ; WX 869 ; N uni04E8 ; B 44 -13 825 752 ; +C -1 ; WX 655 ; N uni04E9 ; B 42 -13 613 560 ; +C -1 ; WX 869 ; N uni04EA ; B 44 -13 825 965 ; +C -1 ; WX 655 ; N uni04EB ; B 42 -13 613 773 ; +C -1 ; WX 814 ; N uni04EC ; B 44 -13 770 965 ; +C -1 ; WX 650 ; N uni04ED ; B 42 -13 608 773 ; +C -1 ; WX 596 ; N uni04EE ; B 4 0 592 903 ; +C -1 ; WX 536 ; N uni04EF ; B 9 -192 527 711 ; +C -1 ; WX 596 ; N uni04F0 ; B 4 0 592 965 ; +C -1 ; WX 536 ; N uni04F1 ; B 9 -192 527 773 ; +C -1 ; WX 596 ; N uni04F2 ; B 4 0 592 1009 ; +C -1 ; WX 536 ; N uni04F3 ; B 9 -192 527 817 ; +C -1 ; WX 635 ; N uni04F4 ; B 66 0 559 965 ; +C -1 ; WX 500 ; N uni04F5 ; B 34 0 437 773 ; +C -1 ; WX 778 ; N uni04F8 ; B 76 0 666 965 ; +C -1 ; WX 635 ; N uni04F9 ; B 63 0 557 773 ; +C -1 ; WX 813 ; N Ccircumflex ; B 44 -13 770 965 ; +C -1 ; WX 647 ; N ccircumflex ; B 42 -13 608 773 ; +C -1 ; WX 813 ; N Cdotaccent ; B 44 -13 770 965 ; +C -1 ; WX 647 ; N cdotaccent ; B 42 -13 608 773 ; +C -1 ; WX 536 ; N Ebreve ; B 76 0 480 959 ; +C -1 ; WX 650 ; N ebreve ; B 42 -13 611 767 ; +C -1 ; WX 872 ; N Gcircumflex ; B 44 -13 831 965 ; +C -1 ; WX 673 ; N gcircumflex ; B 42 -215 610 773 ; +C -1 ; WX 872 ; N Gdotaccent ; B 44 -13 831 965 ; +C -1 ; WX 673 ; N gdotaccent ; B 42 -215 610 773 ; +C -1 ; WX 683 ; N Hcircumflex ; B 76 0 607 965 ; +C -1 ; WX 610 ; N hcircumflex ; B 63 0 547 965 ; +C -1 ; WX 683 ; N Hbar ; B 12 0 674 739 ; +C -1 ; WX 610 ; N hbar ; B 9 0 546 739 ; +C -1 ; WX 226 ; N Itilde ; B -32 0 258 887 ; +C -1 ; WX 200 ; N itilde ; B -45 0 245 742 ; +C -1 ; WX 226 ; N Ibreve ; B -39 0 265 912 ; +C -1 ; WX 200 ; N ibreve ; B -52 0 252 767 ; +C -1 ; WX 686 ; N IJ ; B 76 -14 606 739 ; +C -1 ; WX 330 ; N ij ; B 63 -192 266 739 ; +C -1 ; WX 482 ; N Jcircumflex ; B 11 -14 546 965 ; +C -1 ; WX 203 ; N jcircumflex ; B -74 -192 280 777 ; +C -1 ; WX 502 ; N kgreenlandic ; B 63 0 497 549 ; +C -1 ; WX 462 ; N Ldot ; B 76 0 456 739 ; +C -1 ; WX 320 ; N ldot ; B 63 0 285 739 ; +C -1 ; WX 610 ; N napostrophe ; B 63 0 547 560 ; +C -1 ; WX 740 ; N Eng ; B 76 0 664 739 ; +C -1 ; WX 610 ; N eng ; B 63 0 547 560 ; +C -1 ; WX 869 ; N Obreve ; B 44 -13 825 959 ; +C -1 ; WX 655 ; N obreve ; B 42 -13 613 767 ; +C -1 ; WX 498 ; N Scircumflex ; B 22 -13 476 965 ; +C -1 ; WX 388 ; N scircumflex ; B 18 -13 407 773 ; +C -1 ; WX 426 ; N uni0162 ; B 7 -213 419 739 ; +C -1 ; WX 339 ; N uni0163 ; B 12 -213 327 739 ; +C -1 ; WX 426 ; N Tbar ; B 7 0 419 739 ; +C -1 ; WX 339 ; N tbar ; B 12 0 327 739 ; +C -1 ; WX 655 ; N Utilde ; B 76 -13 579 934 ; +C -1 ; WX 608 ; N utilde ; B 63 -13 545 742 ; +C -1 ; WX 655 ; N Ubreve ; B 76 -13 579 959 ; +C -1 ; WX 608 ; N ubreve ; B 63 -13 545 767 ; +C -1 ; WX 960 ; N Wcircumflex ; B 10 0 950 965 ; +C -1 ; WX 831 ; N wcircumflex ; B 7 0 824 773 ; +C -1 ; WX 592 ; N Ycircumflex ; B 2 0 590 965 ; +C -1 ; WX 536 ; N ycircumflex ; B 9 -192 527 773 ; +C -1 ; WX 314 ; N longs ; B 16 0 311 739 ; +C -1 ; WX 1017 ; N afii61352 ; B 35 0 951 739 ; +C -1 ; WX 768 ; N infinity ; B 42 130 720 520 ; +EndCharMetrics +StartKernData +StartKernPairs 983 +KPX quoteright y -21 +KPX quoteright w -19 +KPX quoteright v -21 +KPX quoteright t -32 +KPX quoteright s -27 +KPX quoteright r -30 +KPX quoteright period -80 +KPX quoteright o -55 +KPX quoteright d -56 +KPX quoteright comma -100 +KPX quoteright Aring -105 +KPX quoteright Adieresis -105 +KPX quoteright Aacute -105 +KPX quoteright AE -183 +KPX quoteright A -105 +KPX comma quoteright -19 +KPX comma quotedblright -17 +KPX comma one -64 +KPX hyphen Y -43 +KPX hyphen W 4 +KPX hyphen V -24 +KPX hyphen T -11 +KPX hyphen Aring 13 +KPX hyphen Adieresis 13 +KPX hyphen Aacute 13 +KPX hyphen AE -21 +KPX hyphen A 13 +KPX period quoteright -58 +KPX period quotedblright -56 +KPX period one -100 +KPX zero seven -30 +KPX zero one -66 +KPX zero four 22 +KPX one zero -27 +KPX one two -51 +KPX one three -55 +KPX one six -49 +KPX one seven -88 +KPX one period -58 +KPX one one -133 +KPX one nine -52 +KPX one four -62 +KPX one five -46 +KPX one eight -46 +KPX one comma -77 +KPX two seven -35 +KPX two one -81 +KPX two four -19 +KPX three seven -51 +KPX three one -91 +KPX three four 12 +KPX four seven -35 +KPX four one -81 +KPX four four 24 +KPX five seven -32 +KPX five one -77 +KPX five four 24 +KPX six seven -64 +KPX six one -94 +KPX six four 24 +KPX seven two -27 +KPX seven three -42 +KPX seven six -60 +KPX seven seven -20 +KPX seven period -115 +KPX seven one -65 +KPX seven four -81 +KPX seven five -47 +KPX seven eight -41 +KPX seven comma -133 +KPX seven colon -75 +KPX eight seven -43 +KPX eight one -84 +KPX eight four 17 +KPX nine seven -31 +KPX nine one -77 +KPX nine four -33 +KPX A y -37 +KPX A w -33 +KPX A v -39 +KPX A u -15 +KPX A t -28 +KPX A quoteright -92 +KPX A quotedblright -90 +KPX A q -21 +KPX A period 13 +KPX A o -20 +KPX A hyphen 13 +KPX A guilsinglleft -22 +KPX A guillemotleft -22 +KPX A g -23 +KPX A e -21 +KPX A d -21 +KPX A comma -5 +KPX A ccedilla -22 +KPX A c -22 +KPX A b 5 +KPX A a -20 +KPX A Y -77 +KPX A W -47 +KPX A V -72 +KPX A Ugrave -29 +KPX A Udieresis -29 +KPX A Ucircumflex -29 +KPX A Uacute -29 +KPX A U -29 +KPX A T -50 +KPX A Q -38 +KPX A Odieresis -38 +KPX A O -38 +KPX A G -38 +KPX A Ccedilla -37 +KPX A C -36 +KPX B Y -26 +KPX B W -2 +KPX B V -24 +KPX B Oslash 9 +KPX B Ograve 6 +KPX B Odieresis 6 +KPX B Ocircumflex 6 +KPX B Oacute 6 +KPX B OE 7 +KPX B O 6 +KPX B Atilde -8 +KPX B Aring -8 +KPX B Adieresis -8 +KPX B Acircumflex -8 +KPX B Aacute -8 +KPX B AE -21 +KPX B A -8 +KPX C Odieresis -18 +KPX C Oacute -18 +KPX C O -18 +KPX C Aring -22 +KPX C Adieresis -22 +KPX C Aacute -22 +KPX C AE -45 +KPX C A -22 +KPX D Y -44 +KPX D X -29 +KPX D W -14 +KPX D V -36 +KPX D T -40 +KPX D J -5 +KPX D Atilde -37 +KPX D Aring -37 +KPX D Agrave -37 +KPX D Adieresis -37 +KPX D Acircumflex -37 +KPX D Aacute -37 +KPX D A -37 +KPX F u -11 +KPX F r -11 +KPX F period -80 +KPX F oslash -5 +KPX F oe -3 +KPX F odieresis -3 +KPX F oacute -3 +KPX F o -3 +KPX F j -7 +KPX F i -5 +KPX F hyphen 23 +KPX F eacute -3 +KPX F e -3 +KPX F comma -98 +KPX F aring -3 +KPX F ae -3 +KPX F adieresis -3 +KPX F aacute -3 +KPX F a -3 +KPX F J -55 +KPX F Atilde -56 +KPX F Aring -56 +KPX F Agrave -56 +KPX F Adieresis -56 +KPX F Acircumflex -56 +KPX F Aacute -56 +KPX F A -56 +KPX G Y -48 +KPX G W -22 +KPX G V -43 +KPX G T -45 +KPX G Atilde -40 +KPX G Aring -40 +KPX G Agrave -40 +KPX G Adieresis -40 +KPX G Acircumflex -40 +KPX G Aacute -40 +KPX G AE -64 +KPX G A -40 +KPX J Aring -27 +KPX J Adieresis -27 +KPX J AE -39 +KPX J A -27 +KPX K y -44 +KPX K udieresis -38 +KPX K u -38 +KPX K odieresis -44 +KPX K oacute -44 +KPX K o -44 +KPX K hyphen -29 +KPX K e -45 +KPX K aring -44 +KPX K ae -44 +KPX K adieresis -44 +KPX K a -44 +KPX K T 37 +KPX K S -16 +KPX K Odieresis -38 +KPX K Oacute -38 +KPX K OE -37 +KPX K O -38 +KPX K G -38 +KPX K C -36 +KPX L y -59 +KPX L udieresis -14 +KPX L u -14 +KPX L quoteright -116 +KPX L quotedblright -114 +KPX L hyphen -79 +KPX L Y -88 +KPX L W -59 +KPX L V -100 +KPX L Udieresis -25 +KPX L U -25 +KPX L T -47 +KPX L S 7 +KPX L Otilde -49 +KPX L Ograve -49 +KPX L Odieresis -49 +KPX L Ocircumflex -49 +KPX L Oacute -49 +KPX L O -49 +KPX L G -48 +KPX L Ccedilla -49 +KPX L C -46 +KPX L Aring 34 +KPX L Adieresis 34 +KPX L Aacute 34 +KPX L AE 34 +KPX L A 34 +KPX N udieresis 13 +KPX N u 13 +KPX N period 3 +KPX N oslash 9 +KPX N odieresis 8 +KPX N oacute 8 +KPX N o 8 +KPX N eacute 7 +KPX N e 7 +KPX N comma -15 +KPX N aring 8 +KPX N ae 7 +KPX N adieresis 8 +KPX N aacute 8 +KPX N a 8 +KPX N Odieresis 9 +KPX N Oacute 9 +KPX N O 9 +KPX N G 9 +KPX N Ccedilla 11 +KPX N C 10 +KPX N AE -1 +KPX O Y -46 +KPX O X -31 +KPX O W -16 +KPX O V -38 +KPX O T -42 +KPX O Aring -39 +KPX O Adieresis -39 +KPX O Aacute -39 +KPX O AE -68 +KPX O A -39 +KPX P period -106 +KPX P oslash -19 +KPX P oe -15 +KPX P odieresis -15 +KPX P oacute -15 +KPX P o -15 +KPX P hyphen -4 +KPX P eacute -15 +KPX P e -15 +KPX P comma -125 +KPX P aring -16 +KPX P ae -16 +KPX P adieresis -16 +KPX P aacute -16 +KPX P a -16 +KPX P J -68 +KPX P Aring -61 +KPX P Adieresis -61 +KPX P Aacute -61 +KPX P AE -108 +KPX P A -61 +KPX R y 20 +KPX R udieresis 7 +KPX R uacute 7 +KPX R u 7 +KPX R oe -7 +KPX R odieresis -7 +KPX R oacute -7 +KPX R o -7 +KPX R hyphen 3 +KPX R eacute -7 +KPX R e -7 +KPX R aring -7 +KPX R ae -7 +KPX R adieresis -7 +KPX R aacute -7 +KPX R a -7 +KPX R Y -14 +KPX R W -3 +KPX R V -11 +KPX R Udieresis 11 +KPX R U 11 +KPX R T -4 +KPX R Odieresis 2 +KPX R Oacute 2 +KPX R OE 2 +KPX R O 2 +KPX R G 1 +KPX R Ccedilla 3 +KPX R C 2 +KPX S t 17 +KPX S Y -10 +KPX S W 3 +KPX S V -9 +KPX S T 3 +KPX S Aring -5 +KPX S Adieresis -5 +KPX S Aacute -5 +KPX S AE -16 +KPX S A -5 +KPX T y -50 +KPX T w -49 +KPX T v -50 +KPX T u -40 +KPX T semicolon -62 +KPX T s -32 +KPX T r -33 +KPX T period -47 +KPX T oslash -45 +KPX T o -48 +KPX T j 6 +KPX T i 8 +KPX T hyphen -11 +KPX T guilsinglleft -42 +KPX T guillemotleft -42 +KPX T g -48 +KPX T e -48 +KPX T comma -65 +KPX T colon -53 +KPX T c -49 +KPX T ae -48 +KPX T a -48 +KPX T Y 38 +KPX T W 35 +KPX T V 34 +KPX T Otilde -42 +KPX T Oslash -38 +KPX T Ograve -42 +KPX T Odieresis -42 +KPX T Ocircumflex -42 +KPX T Oacute -42 +KPX T OE -40 +KPX T O -42 +KPX T J -49 +KPX T G -41 +KPX T C -40 +KPX T Atilde -50 +KPX T Aring -50 +KPX T Agrave -50 +KPX T Adieresis -50 +KPX T Acircumflex -50 +KPX T Aacute -50 +KPX T AE -51 +KPX T A -50 +KPX U r 13 +KPX U period -15 +KPX U p 13 +KPX U n 13 +KPX U m 13 +KPX U comma -36 +KPX U Atilde -30 +KPX U Aring -30 +KPX U Adieresis -30 +KPX U Acircumflex -30 +KPX U Aacute -30 +KPX U AE -50 +KPX U A -30 +KPX V y -8 +KPX V u -34 +KPX V semicolon -70 +KPX V r -32 +KPX V period -92 +KPX V oslash -58 +KPX V o -59 +KPX V i 6 +KPX V hyphen -25 +KPX V guilsinglleft -49 +KPX V guillemotleft -49 +KPX V g -59 +KPX V e -59 +KPX V comma -110 +KPX V colon -60 +KPX V ae -59 +KPX V a -59 +KPX V T 35 +KPX V S -12 +KPX V Otilde -39 +KPX V Oslash -35 +KPX V Ograve -39 +KPX V Odieresis -39 +KPX V Ocircumflex -39 +KPX V Oacute -39 +KPX V O -39 +KPX V G -38 +KPX V C -37 +KPX V Atilde -72 +KPX V Aring -72 +KPX V Agrave -72 +KPX V Adieresis -72 +KPX V Acircumflex -72 +KPX V Aacute -72 +KPX V AE -118 +KPX V A -72 +KPX W y 4 +KPX W u -21 +KPX W semicolon -47 +KPX W r -15 +KPX W period -53 +KPX W oslash -28 +KPX W o -30 +KPX W i 6 +KPX W hyphen 3 +KPX W guilsinglleft -21 +KPX W guillemotleft -21 +KPX W g -30 +KPX W e -30 +KPX W comma -71 +KPX W colon -38 +KPX W ae -30 +KPX W a -30 +KPX W T 35 +KPX W Otilde -16 +KPX W Oslash -12 +KPX W Ograve -16 +KPX W Odieresis -16 +KPX W Ocircumflex -16 +KPX W Oacute -16 +KPX W O -16 +KPX W G -15 +KPX W C -14 +KPX W Atilde -48 +KPX W Aring -48 +KPX W Agrave -48 +KPX W Adieresis -48 +KPX W Acircumflex -48 +KPX W Aacute -48 +KPX W AE -73 +KPX W A -48 +KPX X y -37 +KPX X u -29 +KPX X o -36 +KPX X hyphen -17 +KPX X e -37 +KPX X a -36 +KPX X Q -30 +KPX X Odieresis -31 +KPX X O -31 +KPX X C -29 +KPX Y v -14 +KPX Y u -40 +KPX Y semicolon -78 +KPX Y period -89 +KPX Y p -38 +KPX Y oslash -66 +KPX Y o -68 +KPX Y i 10 +KPX Y hyphen -45 +KPX Y guilsinglleft -62 +KPX Y guillemotleft -63 +KPX Y g -68 +KPX Y e -68 +KPX Y comma -107 +KPX Y colon -69 +KPX Y ae -68 +KPX Y a -68 +KPX Y T 39 +KPX Y S -13 +KPX Y Otilde -46 +KPX Y Oslash -42 +KPX Y Ograve -46 +KPX Y Odieresis -46 +KPX Y Ocircumflex -46 +KPX Y Oacute -46 +KPX Y O -46 +KPX Y G -46 +KPX Y C -44 +KPX Y Atilde -78 +KPX Y Aring -78 +KPX Y Agrave -78 +KPX Y Adieresis -78 +KPX Y Acircumflex -78 +KPX Y Aacute -78 +KPX Y AE -93 +KPX Y A -78 +KPX Z y -8 +KPX Z v -8 +KPX quoteleft Y 2 +KPX quoteleft W 14 +KPX quoteleft V 6 +KPX quoteleft T -17 +KPX quoteleft Aring -92 +KPX quoteleft Adieresis -92 +KPX quoteleft Aacute -92 +KPX quoteleft AE -170 +KPX quoteleft A -92 +KPX a y 5 +KPX a w 6 +KPX a v 5 +KPX a quoteright -7 +KPX a j 14 +KPX b y -23 +KPX b w -19 +KPX b v -25 +KPX c k -4 +KPX c h -4 +KPX e y -23 +KPX e x -20 +KPX e w -20 +KPX e v -24 +KPX e t -23 +KPX e quoteright -31 +KPX f t 34 +KPX f s 13 +KPX f quoteright -5 +KPX f oslash -24 +KPX f oe -19 +KPX f odieresis -19 +KPX f oacute -19 +KPX f o -19 +KPX f l 9 +KPX f j 7 +KPX f i 9 +KPX f f 32 +KPX f eacute -19 +KPX f e -19 +KPX f aring -20 +KPX f ae -21 +KPX f adieresis -20 +KPX f aacute -20 +KPX f a -20 +KPX g r 16 +KPX g odieresis 7 +KPX g oacute 7 +KPX g l 16 +KPX g eacute 7 +KPX g e 7 +KPX g aring 7 +KPX g ae 7 +KPX g adieresis 7 +KPX g a 7 +KPX h y -17 +KPX h quoteright -30 +KPX i j 13 +KPX i T 8 +KPX k udieresis 1 +KPX k u 1 +KPX k s -5 +KPX k period -7 +KPX k odieresis -28 +KPX k oacute -28 +KPX k o -28 +KPX k hyphen -36 +KPX k g -29 +KPX k eacute -28 +KPX k e -28 +KPX k comma -21 +KPX k aring -28 +KPX k ae -28 +KPX k adieresis -28 +KPX k aacute -28 +KPX k a -28 +KPX l y 5 +KPX l v 5 +KPX m y -15 +KPX m w -12 +KPX m v -17 +KPX m p 14 +KPX n y -17 +KPX n w -14 +KPX n v -19 +KPX n quoteright -30 +KPX n p 13 +KPX n T -41 +KPX o y -21 +KPX o x -18 +KPX o w -18 +KPX o v -24 +KPX o t -22 +KPX o quoteright -31 +KPX o T -47 +KPX p y -23 +KPX p t -23 +KPX q u 13 +KPX q c 7 +KPX r z 27 +KPX r y 32 +KPX r x 31 +KPX r w 33 +KPX r v 32 +KPX r u 6 +KPX r t 31 +KPX r semicolon -24 +KPX r s 8 +KPX r r 6 +KPX r quoteright -8 +KPX r q -29 +KPX r period -53 +KPX r p 6 +KPX r oslash -33 +KPX r ograve -28 +KPX r oe -27 +KPX r odieresis -28 +KPX r ocircumflex -28 +KPX r oacute -28 +KPX r o -28 +KPX r n 6 +KPX r m 6 +KPX r l 6 +KPX r k 6 +KPX r j 4 +KPX r i 6 +KPX r hyphen -19 +KPX r h 6 +KPX r g -18 +KPX r f 29 +KPX r egrave -28 +KPX r ecircumflex -28 +KPX r eacute -28 +KPX r e -28 +KPX r d -29 +KPX r comma -70 +KPX r colon -12 +KPX r ccedilla -25 +KPX r c -30 +KPX r aring -28 +KPX r agrave -28 +KPX r ae -28 +KPX r adieresis -28 +KPX r acircumflex -28 +KPX r aacute -28 +KPX r a -28 +KPX s t 8 +KPX s quoteright -16 +KPX t semicolon -25 +KPX t quoteright -9 +KPX t odieresis -24 +KPX t oacute -24 +KPX t o -24 +KPX t h 4 +KPX t eacute -24 +KPX t e -24 +KPX t colon -13 +KPX t aring -25 +KPX t ae -25 +KPX t adieresis -25 +KPX t aacute -25 +KPX t a -25 +KPX t S 14 +KPX u quoteright -7 +KPX v semicolon -31 +KPX v s -2 +KPX v period -70 +KPX v oslash -24 +KPX v ograve -25 +KPX v odieresis -25 +KPX v oacute -25 +KPX v o -25 +KPX v l 6 +KPX v g -21 +KPX v egrave -25 +KPX v ecircumflex -25 +KPX v eacute -25 +KPX v e -25 +KPX v comma -87 +KPX v colon -21 +KPX v c -26 +KPX v atilde -25 +KPX v aring -25 +KPX v agrave -25 +KPX v ae -25 +KPX v adieresis -25 +KPX v acircumflex -25 +KPX v aacute -25 +KPX v a -25 +KPX w semicolon -29 +KPX w period -62 +KPX w oslash -19 +KPX w ograve -20 +KPX w odieresis -20 +KPX w oacute -20 +KPX w o -20 +KPX w l 7 +KPX w hyphen 6 +KPX w g -18 +KPX w egrave -20 +KPX w ecircumflex -20 +KPX w eacute -20 +KPX w e -20 +KPX w comma -79 +KPX w colon -19 +KPX w c -21 +KPX w atilde -20 +KPX w aring -20 +KPX w agrave -20 +KPX w ae -20 +KPX w adieresis -20 +KPX w acircumflex -20 +KPX w aacute -20 +KPX w a -20 +KPX x q -19 +KPX x o -19 +KPX x eacute -19 +KPX x e -19 +KPX x c -20 +KPX x a -19 +KPX y semicolon -31 +KPX y s -3 +KPX y period -72 +KPX y oslash -25 +KPX y ograve -26 +KPX y odieresis -26 +KPX y oacute -26 +KPX y o -26 +KPX y l 6 +KPX y g -22 +KPX y egrave -26 +KPX y ecircumflex -26 +KPX y eacute -26 +KPX y e -26 +KPX y comma -89 +KPX y colon -21 +KPX y c -27 +KPX y atilde -26 +KPX y aring -26 +KPX y agrave -26 +KPX y ae -26 +KPX y adieresis -26 +KPX y acircumflex -26 +KPX y aacute -26 +KPX y a -26 +KPX quotedblleft W 12 +KPX quotedblleft V 3 +KPX quotedblleft T -19 +KPX quotedblleft Aring -95 +KPX quotedblleft Adieresis -95 +KPX quotedblleft Aacute -95 +KPX quotedblleft AE -172 +KPX quotedblleft A -95 +KPX guilsinglright Y -61 +KPX guilsinglright W -21 +KPX guilsinglright V -48 +KPX guilsinglright T -41 +KPX guilsinglright Aring -22 +KPX guilsinglright Adieresis -22 +KPX guilsinglright Aacute -22 +KPX guilsinglright AE -60 +KPX guilsinglright A -22 +KPX quotedblbase Y -93 +KPX quotedblbase W -57 +KPX quotedblbase V -96 +KPX quotedblbase T -52 +KPX quotedblbase AE -8 +KPX quotedblbase A 6 +KPX quotedblright Y -4 +KPX quotedblright W 7 +KPX quotedblright T -5 +KPX quotedblright Aring -101 +KPX quotedblright Adieresis -101 +KPX quotedblright Aacute -101 +KPX quotedblright AE -179 +KPX quotedblright A -101 +KPX guillemotright Y -62 +KPX guillemotright W -21 +KPX guillemotright V -48 +KPX guillemotright T -42 +KPX guillemotright Aring -22 +KPX guillemotright Adieresis -22 +KPX guillemotright Aacute -22 +KPX guillemotright AE -60 +KPX guillemotright A -22 +KPX Oslash A -36 +KPX ae y -22 +KPX ae w -20 +KPX ae v -23 +KPX Adieresis y -37 +KPX Adieresis w -33 +KPX Adieresis v -39 +KPX Adieresis u -15 +KPX Adieresis t -28 +KPX Adieresis quoteright -92 +KPX Adieresis quotedblright -90 +KPX Adieresis q -21 +KPX Adieresis period 13 +KPX Adieresis o -20 +KPX Adieresis hyphen 13 +KPX Adieresis guilsinglleft -22 +KPX Adieresis guillemotleft -22 +KPX Adieresis g -23 +KPX Adieresis d -21 +KPX Adieresis comma -5 +KPX Adieresis c -22 +KPX Adieresis b 5 +KPX Adieresis a -20 +KPX Adieresis Y -77 +KPX Adieresis W -47 +KPX Adieresis V -72 +KPX Adieresis U -29 +KPX Adieresis T -50 +KPX Adieresis Q -38 +KPX Adieresis O -38 +KPX Adieresis G -38 +KPX Adieresis C -36 +KPX Aacute y -37 +KPX Aacute w -33 +KPX Aacute v -39 +KPX Aacute u -15 +KPX Aacute t -28 +KPX Aacute quoteright -92 +KPX Aacute q -21 +KPX Aacute period 13 +KPX Aacute o -20 +KPX Aacute hyphen 13 +KPX Aacute guilsinglleft -22 +KPX Aacute guillemotleft -22 +KPX Aacute g -23 +KPX Aacute e -21 +KPX Aacute d -21 +KPX Aacute comma -5 +KPX Aacute c -22 +KPX Aacute b 5 +KPX Aacute a -20 +KPX Aacute Y -77 +KPX Aacute W -47 +KPX Aacute V -72 +KPX Aacute U -29 +KPX Aacute T -50 +KPX Aacute Q -38 +KPX Aacute O -38 +KPX Aacute G -38 +KPX Aacute C -36 +KPX Agrave period 13 +KPX Agrave comma -5 +KPX Agrave Y -77 +KPX Agrave W -47 +KPX Agrave V -72 +KPX Agrave U -29 +KPX Agrave T -50 +KPX Agrave Q -38 +KPX Agrave O -38 +KPX Agrave G -38 +KPX Agrave C -36 +KPX Acircumflex period 13 +KPX Acircumflex comma -5 +KPX Acircumflex Y -77 +KPX Acircumflex W -47 +KPX Acircumflex V -72 +KPX Acircumflex U -29 +KPX Acircumflex T -50 +KPX Acircumflex Q -38 +KPX Acircumflex O -38 +KPX Acircumflex G -38 +KPX Acircumflex C -36 +KPX Atilde period 13 +KPX Atilde comma -5 +KPX Atilde Y -77 +KPX Atilde W -47 +KPX Atilde V -72 +KPX Atilde U -29 +KPX Atilde T -50 +KPX Atilde Q -38 +KPX Atilde O -38 +KPX Atilde G -38 +KPX Atilde C -36 +KPX Aring y -37 +KPX Aring w -33 +KPX Aring v -39 +KPX Aring u -15 +KPX Aring t -28 +KPX Aring quoteright -92 +KPX Aring quotedblright -90 +KPX Aring q -21 +KPX Aring period 13 +KPX Aring o -20 +KPX Aring hyphen 13 +KPX Aring guilsinglleft -22 +KPX Aring guillemotleft -22 +KPX Aring g -23 +KPX Aring e -21 +KPX Aring d -21 +KPX Aring comma -5 +KPX Aring c -22 +KPX Aring b 5 +KPX Aring a -20 +KPX Aring Y -77 +KPX Aring W -47 +KPX Aring V -72 +KPX Aring U -29 +KPX Aring T -50 +KPX Aring Q -38 +KPX Aring O -38 +KPX Aring G -38 +KPX Aring C -36 +KPX Ccedilla A -22 +KPX Odieresis Y -46 +KPX Odieresis X -31 +KPX Odieresis W -16 +KPX Odieresis V -38 +KPX Odieresis T -42 +KPX Odieresis A -39 +KPX Oacute Y -46 +KPX Oacute W -16 +KPX Oacute V -38 +KPX Oacute T -42 +KPX Oacute A -39 +KPX Ograve Y -46 +KPX Ograve V -38 +KPX Ograve T -42 +KPX Ocircumflex Y -46 +KPX Ocircumflex V -38 +KPX Ocircumflex T -42 +KPX Otilde Y -46 +KPX Otilde V -38 +KPX Otilde T -42 +KPX Udieresis r 13 +KPX Udieresis period -15 +KPX Udieresis p 13 +KPX Udieresis n 13 +KPX Udieresis m 13 +KPX Udieresis comma -36 +KPX Udieresis b 13 +KPX Udieresis A -30 +KPX Uacute r 13 +KPX Uacute period -15 +KPX Uacute p 13 +KPX Uacute n 13 +KPX Uacute m 13 +KPX Uacute comma -36 +KPX Uacute A -30 +KPX Ugrave A -30 +KPX Ucircumflex A -30 +KPX adieresis y 5 +KPX adieresis w 6 +KPX adieresis v 5 +KPX aacute y 5 +KPX aacute w 6 +KPX aacute v 5 +KPX agrave y 5 +KPX agrave w 6 +KPX agrave v 5 +KPX aring y 5 +KPX aring w 6 +KPX aring v 5 +KPX eacute y -23 +KPX eacute w -20 +KPX eacute v -24 +KPX ecircumflex y -23 +KPX ecircumflex w -20 +KPX ecircumflex v -24 +KPX odieresis y -21 +KPX odieresis x -18 +KPX odieresis w -18 +KPX odieresis v -24 +KPX odieresis t -22 +KPX oacute y -21 +KPX oacute w -18 +KPX oacute v -24 +KPX ograve y -21 +KPX ograve w -18 +KPX ograve v -24 +KPX ocircumflex t -22 +EndKernPairs +EndKernData +EndFontMetrics diff --git a/demo/type1/a010013l.pfb b/demo/type1/a010013l.pfb new file mode 100644 index 0000000..0f23987 Binary files /dev/null and b/demo/type1/a010013l.pfb differ diff --git a/plugin/ubuntu-18.04/libTSPDF.so b/plugin/ubuntu-18.04/libTSPDF.so new file mode 100644 index 0000000..d69a925 Binary files /dev/null and b/plugin/ubuntu-18.04/libTSPDF.so differ diff --git a/plugin/windows-x64/TSPDF.dll b/plugin/windows-x64/TSPDF.dll new file mode 100644 index 0000000..3576c7d Binary files /dev/null and b/plugin/windows-x64/TSPDF.dll differ