version_pdf.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>{{ version.document.title }}</title>
  6. <style>
  7. @page {
  8. size: A4;
  9. margin: 2cm;
  10. @bottom-right {
  11. content: "Page " counter(page) " of " counter(pages);
  12. font-size: 10pt;
  13. }
  14. }
  15. body {
  16. font-family: "Helvetica", sans-serif;
  17. font-size: 12pt;
  18. line-height: 1.6;
  19. }
  20. h1, h2, h3, h4 {
  21. font-family: "Times New Roman", serif;
  22. color: #005595; /* Siemens-like blue */
  23. }
  24. h1 {
  25. font-size: 24pt;
  26. text-align: center;
  27. margin-bottom: 0.5cm;
  28. }
  29. .version-subtitle {
  30. font-size: 14pt;
  31. text-align: center;
  32. color: #555;
  33. margin-bottom: 2cm;
  34. }
  35. h2 {
  36. font-size: 18pt;
  37. border-bottom: 2px solid #009999; /* Siemens-like teal */
  38. padding-bottom: 5px;
  39. margin-top: 1.5cm;
  40. }
  41. p {
  42. text-align: justify;
  43. }
  44. /* --- ADD THIS BLOCK --- */
  45. /* Forces WeasyPrint to respect the width/height set by TinyMCE */
  46. img[width] {
  47. width: attr(width px);
  48. }
  49. img[height] {
  50. height: attr(height px);
  51. }
  52. img {
  53. max-width: 100%;
  54. height: auto;
  55. }
  56. </style>
  57. </head>
  58. <body>
  59. <!-- Use the parent document's title -->
  60. <h1>{{ version.document.title }}</h1>
  61. <!-- Add a clear subtitle for the version number -->
  62. <div class="version-subtitle">Version {{ version.version_number }}</div>
  63. <h2>Introduction</h2>
  64. <div>{{ version.introduction|safe }}</div>
  65. <h2>Main Body</h2>
  66. <div>{{ version.main_body|safe }}</div>
  67. <h2>Conclusion</h2>
  68. <div>{{ version.conclusion|safe }}</div>
  69. </body>
  70. </html>