You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.8 KiB

12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
  1. /*
  2. * << Haru Free PDF Library 2.0.0 >> -- font_demo.cpp
  3. *
  4. * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
  5. *
  6. * Permission to use, copy, modify, distribute and sell this software
  7. * and its documentation for any purpose is hereby granted without fee,
  8. * provided that the above copyright notice appear in all copies and
  9. * that both that copyright notice and this permission notice appear
  10. * in supporting documentation.
  11. * It is provided "as is" without express or implied warranty.
  12. *
  13. */
  14. #include <assert.h>
  15. #include <iconv.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include <fstream>
  20. #include <functional>
  21. #include <iostream>
  22. #include <list>
  23. #include <map>
  24. #include <memory>
  25. #include <set>
  26. #include <sstream>
  27. #include <string>
  28. #include <vector>
  29. #include "appbase/utils/zsimplepdf.hpp"
  30. using namespace std;
  31. using namespace iflytop;
  32. int main() {
  33. ZSimplePDF pdf("test.pdf");
  34. pdf.newConent(30);
  35. pdf.addText("Page0 Size30 文件头.....\n");
  36. pdf.newConent(20);
  37. pdf.addText("文件内容 文件内容\n");
  38. pdf.addText("文件内容 文件内容\n");
  39. pdf.addText("文件内容 文件内容\n");
  40. pdf.newConent(15);
  41. pdf.addText("文件内容 文件内容\n");
  42. pdf.newPage();
  43. pdf.newConent(30);
  44. pdf.addText("Page1 Size30 文件头.....\n");
  45. pdf.newConent(20);
  46. pdf.addText("文件内容 文件内容\n");
  47. pdf.addText("文件内容 文件内容\n");
  48. pdf.addText("文件内容 文件内容\n");
  49. pdf.newConent(15);
  50. pdf.addText("文件内容 文件内容\n");
  51. pdf.addText("\n");
  52. pdf.addText("\n");
  53. pdf.addText("\n");
  54. pdf.addText("\n");
  55. pdf.addText("\n");
  56. pdf.addText("\n");
  57. pdf.addText("\n");
  58. pdf.addText("\n");
  59. pdf.addText("\n");
  60. pdf.addText("\n");
  61. pdf.dump();
  62. // pdf.dump("test.pdf", "940年3月,英国物理学家奥托弗里施鲁道夫佩尔斯撰写了弗");
  63. return 0;
  64. }