32#include <scolMemoryHelper.hpp>
69int destroyPdfObj(mmachine m, SCOL_PTR_TYPE handsys,
int handscol)
71 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(handscol));
74 MMsetPointer<SPdfDoc*>(m, MTOP(handscol), 0);
77 MMechostr(MSKDEBUG,
"ObjPdfDoc destroyed.\n");
88int destroyPdfPageObj(mmachine m, SCOL_PTR_TYPE handsys,
int handscol)
90 HPDF_Page pdfpage = MMgetPointer<HPDF_Page>(m, MTOP(handscol));
91 MMsetPointer<HPDF_Page>(m, MTOP(handscol), 0);
94 MMechostr(MSKDEBUG,
"ObjPdfPage destroyed.\n");
114 MMechostr(0,
"_CRpdfDocument\n");
119 int pDpi = MMpull(m);
120 int pAuthor = MMpull(m);
121 int pCreator = MMpull(m);
122 int pTitle = MMpull(m);
125 int channel = MMget(m, 0);
130 MMechostr(MSKDEBUG,
"_CRpdfDocument : Channel NIL\n");
134 std::string title = MMstartstr(m, MTOP(pTitle));
135 std::string creator = MMstartstr(m, MTOP(pCreator));
136 std::string author = MMstartstr(m, MTOP(pAuthor));
138 unsigned int dpiRes = 72;
140 dpiRes = std::abs(MTOI(pDpi));
145 MMechostr(MSKDEBUG,
"_CRpdfDocument : new PDF document failed\n");
151 if ((MMpushPointer(m, pdfdoc) != 0))
159 k = OBJcreate(m, OBJ_PDFDOC_SCOL, SCOL_PTR pdfdoc, NIL, 0);
178 MMechostr(MSKDEBUG,
"_DSpdfDocument\n");
181 int pdfTab = MMget(m, 0);
188 OBJdelTM(m, OBJ_PDFDOC_SCOL, pdfTab);
189 MMset(m, 0, ITOM(0));
192 MMechostr(MSKDEBUG,
"ok\n");
238 MMechostr(MSKDEBUG,
"_SetPdfDocumentCharset\n");
241 int pCharset = MMpull(m);
242 int pdfTab = MMget(m, 0);
243 if ((pdfTab == NIL) || (pCharset == NIL))
249 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
256 std::string charset = MMstartstr(m, MTOP(pCharset));
259 pdfdoc->SetCharset(charset);
261 catch(std::exception &)
267 MMset(m, 0, ITOM(0));
270 MMechostr(MSKDEBUG,
"ok\n");
287 MMechostr(MSKDEBUG,
"_SavePdfDocument\n");
290 int pFile = MMpull(m);
291 int pdfTab = MMget(m, 0);
292 if ((pdfTab == NIL) || (pFile == NIL))
298 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
305 std::string path = MMstartstr(m, MTOP(pFile));
308 pdfdoc->SaveToFile(path);
310 catch(std::exception &)
316 MMset(m, 0, ITOM(0));
319 MMechostr(MSKDEBUG,
"ok\n");
341 MMechostr(MSKDEBUG,
"_SetPdfPageMode\n");
344 int pMode = MMpull(m);
345 int pdfTab = MMget(m, 0);
346 if ((pdfTab == NIL) || (pMode == NIL))
352 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
359 int mode = MTOI(pMode);
362 pdfdoc->SetPageMode((HPDF_PageMode)mode);
364 catch(std::exception &)
370 MMset(m, 0, ITOM(0));
373 MMechostr(MSKDEBUG,
"ok\n");
397 MMechostr(MSKDEBUG,
"_SetPdfLayoutMode\n");
400 int pMode = MMpull(m);
401 int pdfTab = MMget(m, 0);
402 if ((pdfTab == NIL) || (pMode == NIL))
408 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
415 int mode = MTOI(pMode);
418 pdfdoc->SetPageLayout((HPDF_PageLayout)mode);
420 catch(std::exception &)
426 MMset(m, 0, ITOM(0));
429 MMechostr(MSKDEBUG,
"ok\n");
446 MMechostr(MSKDEBUG,
"_LoadPdfTrueTypeFont\n");
449 int pFile = MMpull(m);
450 int pdfTab = MMget(m, 0);
451 if ((pdfTab == NIL) || (pFile == NIL))
457 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
464 std::string path = MMstartstr(m, MTOP(pFile));
465 std::string fontname;
468 fontname = pdfdoc->LoadFontTTF(path);
470 catch(std::exception &)
476 Mpushstrbloc(m, (
char*)fontname.c_str());
479 MMechostr(MSKDEBUG,
"ok\n");
496 MMechostr(MSKDEBUG,
"_GetPdfPageSize\n");
499 int pPage = MMpull(m);
500 int pdfTab = MMget(m, 0);
501 if ((pdfTab == NIL) || (pPage == NIL))
507 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
514 HPDF_Page page = MMgetPointer<HPDF_Page>(m, MTOP(pPage));
525 width = pdfdoc->GetPageWidth(page);
526 height = pdfdoc->GetPageHeight(page);
528 catch(std::exception &)
534 int tuple = MMmalloc(m, 2, TYPETAB);
540 MMstore(m, tuple, 0, FTOM(width));
541 MMstore(m, tuple, 1, FTOM(height));
542 MMset(m, 0, PTOM(tuple));
545 MMechostr(MSKDEBUG,
"ok\n");
565 MMechostr(MSKDEBUG,
"_GetPdfPageTextWidth\n");
568 int pFontSize = MMpull(m);
569 int pFontName = MMpull(m);
570 int pText = MMpull(m);
571 int pPage = MMpull(m);
572 int pdfTab = MMget(m, 0);
573 if ((pdfTab == NIL) || (pPage == NIL) || (pText == NIL))
579 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
586 HPDF_Page page = MMgetPointer<HPDF_Page>(m, MTOP(pPage));
593 std::string text = MMstartstr(m, MTOP(pText));
595 std::string fontName(
"Helvetica");
596 if (pFontName != NIL)
597 fontName = MMstartstr(m, MTOP(pFontName));
600 if (pFontSize != NIL)
601 fontSize = MTOF(pFontSize);
606 width = pdfdoc->GetTextWidth(page, text, fontName, fontSize);
608 catch(std::exception &)
614 MMset(m, 0, FTOM(width));
617 MMechostr(MSKDEBUG,
"ok\n");
651 MMechostr(MSKDEBUG,
"_AddPdfPage\n");
654 int pDir = MMpull(m);
655 int pSize = MMpull(m);
656 int pdfTab = MMget(m, 0);
663 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
670 HPDF_PageSizes size = HPDF_PAGE_SIZE_A4;
671 HPDF_PageDirection dir = HPDF_PAGE_PORTRAIT;
674 size = (HPDF_PageSizes)MTOI(pSize);
677 dir = (HPDF_PageDirection)MTOI(pDir);
682 page = pdfdoc->AddPage(size, dir);
684 catch(std::exception &)
694 int p = OBJfindTH(m, OBJ_PDFDOC_SCOL, SCOL_PTR pdfdoc);
696 MMpush(m, MMfetch(m, p, OFFOBJCHN));
698 MMpushPointer(m, page);
701 int k = OBJcreate(m, OBJ_PDFPAGE_SCOL, SCOL_PTR page, OBJ_PDFDOC_SCOL, SCOL_PTR pdfdoc);
704 MMechostr(MSKDEBUG,
"ok\n");
748 MMechostr(MSKDEBUG,
"_AddPdfPageText\n");
751 int pAlign = MMpull(m);
752 int pFontSize = MMpull(m);
753 int pFontName = MMpull(m);
754 int pColor = MMpull(m);
755 int pPos = MMpull(m);
756 int pText = MMpull(m);
757 int pPage = MMpull(m);
758 int pdfTab = MMget(m, 0);
759 if ((pdfTab == NIL) || (pPage == NIL) || (pText == NIL))
765 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
772 HPDF_Page page = MMgetPointer<HPDF_Page>(m, MTOP(pPage));
778 std::string text = MMstartstr(m, MTOP(pText));
780 float xPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 0));
781 float yPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 1));
785 color = MTOI(pColor);
787 std::string fontName(
"Helvetica");
788 if (pFontName != NIL)
789 fontName = MMstartstr(m, MTOP(pFontName));
792 if (pFontSize != NIL)
793 fontSize = MTOF(pFontSize);
795 int align = SPdfDoc::EM_LEFT|SPdfDoc::EM_TOP;
797 align = MTOI(pAlign);
801 pdfdoc->AddPageText(page, text, xPos, yPos, color, fontName, fontSize, align);
803 catch(std::exception &)
809 MMset(m, 0, ITOM(0));
812 MMechostr(MSKDEBUG,
"ok\n");
839 MMechostr(MSKDEBUG,
"_AddPdfPageBitmap\n");
842 int pAlign = MMpull(m);
843 int pSize = MMpull(m);
844 int pPos = MMpull(m);
845 int pBmp = MMpull(m);
846 int pPage = MMpull(m);
847 int pdfTab = MMget(m, 0);
848 if ((pdfTab == NIL) || (pPage == NIL) || (pBmp == NIL))
854 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
861 HPDF_Page page = MMgetPointer<HPDF_Page>(m, MTOP(pPage));
868 PtrObjVoid scolPtr = (PtrObjVoid) MMstart(m, MTOP(pBmp));
869 if(scolPtr->Type != OBJ_TYPE_BITMAP << 1)
874 PtrObjBitmap bitmap = (PtrObjBitmap) MMstart(m, MTOP(scolPtr->Buffer));
876 float xPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 0));
877 float yPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 1));
880 float width = (pSize == NIL) ? (
float)bitmap->TailleW : MTOF(MMfetch(m, MTOP(pSize), 0));
881 float height = (pSize == NIL) ? (
float)bitmap->TailleH : MTOF(MMfetch(m, MTOP(pSize), 1));
883 int align = SPdfDoc::EM_LEFT|SPdfDoc::EM_TOP;
885 align = MTOI(pAlign);
889 pdfdoc->AddPageBitmap(page, bitmap, xPos, yPos, width, height, align);
891 catch(std::exception &)
897 MMset(m, 0, ITOM(0));
900 MMechostr(MSKDEBUG,
"ok\n");
927 MMechostr(MSKDEBUG,
"_AddPdfPageImage\n");
930 int pAlign = MMpull(m);
931 int pSize = MMpull(m);
932 int pPos = MMpull(m);
933 int pPath = MMpull(m);
934 int pPage = MMpull(m);
935 int pdfTab = MMget(m, 0);
936 if ((pdfTab == NIL) || (pPage == NIL) || (pPath == NIL))
942 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
949 HPDF_Page page = MMgetPointer<HPDF_Page>(m, MTOP(pPage));
956 std::string path = MMstartstr(m, MTOP(pPath));
958 float xPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 0));
959 float yPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 1));
961 float width = (pSize == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pSize), 0));
962 float height = (pSize == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pSize), 1));
964 int align = SPdfDoc::EM_LEFT|SPdfDoc::EM_TOP;
966 align = MTOI(pAlign);
970 pdfdoc->AddPageImage(page, path, xPos, yPos, width, height, align);
972 catch(std::exception &)
978 MMset(m, 0, ITOM(0));
981 MMechostr(MSKDEBUG,
"ok\n");
1011 MMechostr(MSKDEBUG,
"_AddPdfPageRectangle\n");
1014 int pAlign = MMpull(m);
1015 int pFilled = MMpull(m);
1016 int pFillColor = MMpull(m);
1017 int pLineColor = MMpull(m);
1018 int pLineWidth = MMpull(m);
1019 int pSize = MMpull(m);
1020 int pPos = MMpull(m);
1021 int pPage = MMpull(m);
1022 int pdfTab = MMget(m, 0);
1023 if ((pdfTab == NIL) || (pPage == NIL) || (pSize == NIL))
1029 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
1036 HPDF_Page page = MMgetPointer<HPDF_Page>(m, MTOP(pPage));
1043 float xPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 0));
1044 float yPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 1));
1046 float width = (pSize == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pSize), 0));
1047 float height = (pSize == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pSize), 1));
1049 float lineWidth = 1.0f;
1050 if (pLineWidth != NIL)
1051 lineWidth = std::abs(MTOF(pLineWidth));
1053 unsigned int lineColor = 0;
1054 if (pLineColor != NIL)
1055 lineColor = MTOI(pLineColor);
1057 unsigned int fillColor = 0;
1058 if (pFillColor != NIL)
1059 fillColor = MTOI(pFillColor);
1061 bool filled =
false;
1063 filled = (MTOI(pFilled) > 0) ?
true :
false;
1065 int align = SPdfDoc::EM_LEFT|SPdfDoc::EM_TOP;
1067 align = MTOI(pAlign);
1071 pdfdoc->AddPageRectangle(page, xPos, yPos, width, height, lineWidth, lineColor, fillColor, filled, align);
1073 catch(std::exception &)
1079 MMset(m, 0, ITOM(0));
1082 MMechostr(MSKDEBUG,
"ok\n");
1112 MMechostr(MSKDEBUG,
"_AddPdfPageEllipse\n");
1115 int pAlign = MMpull(m);
1116 int pFilled = MMpull(m);
1117 int pFillColor = MMpull(m);
1118 int pLineColor = MMpull(m);
1119 int pLineWidth = MMpull(m);
1120 int pSize = MMpull(m);
1121 int pPos = MMpull(m);
1122 int pPage = MMpull(m);
1123 int pdfTab = MMget(m, 0);
1124 if ((pdfTab == NIL) || (pPage == NIL) || (pSize == NIL))
1130 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
1137 HPDF_Page page = MMgetPointer<HPDF_Page>(m, MTOP(pPage));
1144 float xPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 0));
1145 float yPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 1));
1147 float width = (pSize == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pSize), 0));
1148 float height = (pSize == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pSize), 1));
1150 float lineWidth = 1.0f;
1151 if (pLineWidth != NIL)
1152 lineWidth = std::abs(MTOF(pLineWidth));
1154 unsigned int lineColor = 0;
1155 if (pLineColor != NIL)
1156 lineColor = MTOI(pLineColor);
1158 unsigned int fillColor = 0;
1159 if (pFillColor != NIL)
1160 fillColor = MTOI(pFillColor);
1162 bool filled =
false;
1164 filled = (MTOI(pFilled) > 0) ?
true :
false;
1166 int align = SPdfDoc::EM_LEFT|SPdfDoc::EM_TOP;
1168 align = MTOI(pAlign);
1172 pdfdoc->AddPageEllipse(page, xPos, yPos, width, height, lineWidth, lineColor, fillColor, filled, align);
1174 catch(std::exception &)
1180 MMset(m, 0, ITOM(0));
1183 MMechostr(MSKDEBUG,
"ok\n");
1204 MMechostr(MSKDEBUG,
"_AddPdfPageLine\n");
1207 int pLineColor = MMpull(m);
1208 int pLineWidth = MMpull(m);
1209 int pDest = MMpull(m);
1210 int pPos = MMpull(m);
1211 int pPage = MMpull(m);
1212 int pdfTab = MMget(m, 0);
1213 if ((pdfTab == NIL) || (pPage == NIL) || (pPos == NIL) || (pDest == NIL))
1219 SPdfDoc* pdfdoc = MMgetPointer<SPdfDoc*>(m, MTOP(pdfTab));
1226 HPDF_Page page = MMgetPointer<HPDF_Page>(m, MTOP(pPage));
1233 float xPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 0));
1234 float yPos = (pPos == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pPos), 1));
1236 float xDest = (pDest == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pDest), 0));
1237 float yDest = (pDest == NIL) ? 0.0f : MTOF(MMfetch(m, MTOP(pDest), 1));
1239 float lineWidth = 1.0f;
1240 if (pLineWidth != NIL)
1241 lineWidth = std::abs(MTOF(pLineWidth));
1243 unsigned int lineColor = 0;
1244 if (pLineColor != NIL)
1245 lineColor = MTOI(pLineColor);
1249 pdfdoc->AddPageLine(page, xPos, yPos, xDest, yDest, lineWidth, lineColor);
1251 catch(std::exception &)
1257 MMset(m, 0, ITOM(0));
1260 MMechostr(MSKDEBUG,
"ok\n");
1281 "PDF_PAGE_EXECUTIVE",
1288 "PDF_PAGE_PORTRAIT",
1289 "PDF_PAGE_LANDSCAPE",
1291 "PDF_PAGE_MODE_EOF",
1292 "PDF_PAGE_MODE_FULLSCREEN",
1293 "PDF_PAGE_MODE_NONE",
1294 "PDF_PAGE_MODE_OUTLINE",
1295 "PDF_PAGE_MODE_THUMBS",
1297 "PDF_PAGE_LAYOUT_EOF",
1298 "PDF_PAGE_LAYOUT_ONE_COLUMN",
1299 "PDF_PAGE_LAYOUT_SINGLE",
1300 "PDF_PAGE_LAYOUT_TWO_COLUMN_LEFT",
1301 "PDF_PAGE_LAYOUT_TWO_COLUMN_RIGHT",
1302 "PDF_PAGE_LAYOUT_TWO_PAGE_LEFT",
1303 "PDF_PAGE_LAYOUT_TWO_PAGE_RIGHT",
1314 "_SetPdfDocumentCharset",
1317 "_SetPdfLayoutMode",
1318 "_LoadPdfTrueTypeFont",
1320 "_GetPdfPageTextWidth",
1323 "_AddPdfPageBitmap",
1325 "_AddPdfPageRectangle",
1326 "_AddPdfPageEllipse",
1333#define NPDFPKG (sizeof(mPDFname)/sizeof(char*))
1338int (*mPDFfun[NPDFPKG])(mmachine m)=
1343 SCOL_TYPTYPE(HPDF_PAGE_SIZE_A3),
1344 SCOL_TYPTYPE(HPDF_PAGE_SIZE_A4),
1345 SCOL_TYPTYPE(HPDF_PAGE_SIZE_A5),
1346 SCOL_TYPTYPE(HPDF_PAGE_SIZE_B4),
1347 SCOL_TYPTYPE(HPDF_PAGE_SIZE_B5),
1348 SCOL_TYPTYPE(HPDF_PAGE_SIZE_COMM10),
1349 SCOL_TYPTYPE(HPDF_PAGE_SIZE_EOF),
1350 SCOL_TYPTYPE(HPDF_PAGE_SIZE_EXECUTIVE),
1351 SCOL_TYPTYPE(HPDF_PAGE_SIZE_LEGAL),
1352 SCOL_TYPTYPE(HPDF_PAGE_SIZE_LETTER),
1353 SCOL_TYPTYPE(HPDF_PAGE_SIZE_US4x6),
1354 SCOL_TYPTYPE(HPDF_PAGE_SIZE_US4x8),
1355 SCOL_TYPTYPE(HPDF_PAGE_SIZE_US5x7),
1357 SCOL_TYPTYPE(HPDF_PAGE_PORTRAIT),
1358 SCOL_TYPTYPE(HPDF_PAGE_LANDSCAPE),
1360 SCOL_TYPTYPE(HPDF_PAGE_MODE_EOF),
1361 SCOL_TYPTYPE(HPDF_PAGE_MODE_FULL_SCREEN),
1362 SCOL_TYPTYPE(HPDF_PAGE_MODE_USE_NONE),
1363 SCOL_TYPTYPE(HPDF_PAGE_MODE_USE_OUTLINE),
1364 SCOL_TYPTYPE(HPDF_PAGE_MODE_USE_THUMBS),
1366 SCOL_TYPTYPE(HPDF_PAGE_LAYOUT_EOF),
1367 SCOL_TYPTYPE(HPDF_PAGE_LAYOUT_ONE_COLUMN),
1368 SCOL_TYPTYPE(HPDF_PAGE_LAYOUT_SINGLE),
1369 SCOL_TYPTYPE(HPDF_PAGE_LAYOUT_TWO_COLUMN_LEFT),
1370 SCOL_TYPTYPE(HPDF_PAGE_LAYOUT_TWO_COLUMN_RIGHT),
1371 SCOL_TYPTYPE(HPDF_PAGE_LAYOUT_TWO_PAGE_LEFT),
1372 SCOL_TYPTYPE(HPDF_PAGE_LAYOUT_TWO_PAGE_RIGHT),
1374 SCOL_TYPTYPE(SPdfDoc::EM_LEFT),
1375 SCOL_TYPTYPE(SPdfDoc::EM_RIGHT),
1376 SCOL_TYPTYPE(SPdfDoc::EM_CENTER),
1377 SCOL_TYPTYPE(SPdfDoc::EM_TOP),
1378 SCOL_TYPTYPE(SPdfDoc::EM_BOTTOM),
1379 SCOL_TYPTYPE(SPdfDoc::EM_MIDDLE),
1402int mPDFnarg[NPDFPKG]=
1466char* mPDFtype[NPDFPKG]=
1509 "fun [Chn S S S I] ObjPdfDoc",
1510 "fun [ObjPdfDoc] I",
1511 "fun [ObjPdfDoc S] I",
1512 "fun [ObjPdfDoc W] I",
1513 "fun [ObjPdfDoc I] I",
1514 "fun [ObjPdfDoc I] I",
1515 "fun [ObjPdfDoc P] S",
1516 "fun [ObjPdfDoc ObjPdfPage] [F F]",
1517 "fun [ObjPdfDoc ObjPdfPage S S F] F",
1518 "fun [ObjPdfDoc I I] ObjPdfPage",
1519 "fun [ObjPdfDoc ObjPdfPage S [F F] I S F I] I",
1520 "fun [ObjPdfDoc ObjPdfPage ObjBitmap [F F] [F F] I] I",
1521 "fun [ObjPdfDoc ObjPdfPage P [F F] [F F] I] I",
1522 "fun [ObjPdfDoc ObjPdfPage [F F] [F F] F I I I I] I",
1523 "fun [ObjPdfDoc ObjPdfPage [F F] [F F] F I I I I] I",
1524 "fun [ObjPdfDoc ObjPdfPage [F F] [F F] F I] I"
1535int LoadPdfDoc(mmachine m)
1539 MMechostr(MSKDEBUG,
"\n" );
1540 MMechostr(MSKDEBUG,
" > Loading PDF document Support\n");
1543 OBJ_PDFDOC_SCOL = OBJregister(0 , 0, destroyPdfObj,
"OBJ_PDFDOC_SCOL");
1544 OBJ_PDFPAGE_SCOL = OBJregister(0 , 1, destroyPdfPageObj,
"OBJ_PDFPAGE_SCOL");
1545 k = PKhardpak(m,
"mPDFDOC.pkg-1.0", NPDFPKG, mPDFname, mPDFfun, mPDFnarg, mPDFtype);
1547 MMechostr(MSKDEBUG,
" > Successfully Loaded\n\n");
1553 MMechostr(MSKDEBUG,
"\n" );
1554 MMechostr(MSKDEBUG,
" > Unloading PDF document Support\n");
1556 MMechostr(MSKDEBUG,
" > Successfully unloaded\n\n");
1568extern "C" SCOL_EXPORT
int ScolLoadPlugin(mmachine m, cbmachine w)
1570extern "C" SCOL_EXPORT
int ScolSPdfLoadPlugin(mmachine m, cbmachine w)
1576 return LoadPdfDoc(m);
1584extern "C" SCOL_EXPORT
int ScolUnloadPlugin()
1586extern "C" SCOL_EXPORT
int ScolSPdfUnloadPlugin()
1589 return ClosePdfDoc();
int _GetPdfPageTextWidth(mmachine m)
_GetPdfPageTextWidth : Get a PDF text width from a font
int _AddPdfPageLine(mmachine m)
_AddPdfPageLine : Add a line to a PDF page
int _CRpdfDocument(mmachine m)
_CRpdfDocument : This function create a PDF document object
int _AddPdfPageBitmap(mmachine m)
_AddPdfPageBitmap : Add a bitmap to a PDF page
int _GetPdfPageSize(mmachine m)
_GetPdfPageSize : Get a PDF page size
int _SetPdfPageMode(mmachine m)
_SetPdfPageMode : Set the page mode of a PDF document
int _SetPdfLayoutMode(mmachine m)
_SetPdfLayoutMode : Set the layout mode of a PDF document
int _SetPdfDocumentCharset(mmachine m)
_SetPdfDocumentCharset : Set the current charset of a PDF document
int _LoadPdfTrueTypeFont(mmachine m)
_LoadPdfTrueTypeFont : load a TrueType font file into a PDF document
int _AddPdfPage(mmachine m)
_AddPdfPage : Add a page to a PDF document
int _AddPdfPageText(mmachine m)
_AddPdfPageText : Add text to a PDF page
int _SavePdfDocument(mmachine m)
_SavePdfDocument : Save a PDF document to a file
int _AddPdfPageRectangle(mmachine m)
_AddPdfPageRectangle : Add a ractangle to a PDF page
int _DSpdfDocument(mmachine m)
_DSpdfDocument : Destroy PDF document object
int _AddPdfPageImage(mmachine m)
_AddPdfPageImage : Add an image to a PDF page from a jpg or png file
int _AddPdfPageEllipse(mmachine m)
_AddPdfPageEllipse : Add an ellipse to a PDF page