Przeglądaj źródła

Fuerza el uso de los tamaños definidos de las imagenes a la hora de exportare a pdf

Celestino Rey 5 miesięcy temu
rodzic
commit
c8da41bfd0

+ 1 - 1
K8S/Makefile

@@ -1,5 +1,5 @@
 export REGISTRO=harbor.rancher.lab:30002\/siemensrad
-export IMG_VERSION = alpine-31
+export IMG_VERSION = alpine-35
 export NAMESPACE = trgenerator
 
 # limpia todo

+ 1 - 1
src/doc_generator/settings.py

@@ -83,7 +83,7 @@ WSGI_APPLICATION = 'doc_generator.wsgi.application'
 # Database
 # https://docs.djangoproject.com/en/5.2/ref/settings/#databases
 
-if DEBUG:
+if DEBUG == "True":
     DATABASES = { 
         'default': {
             'ENGINE': 'django.db.backends.sqlite3',

+ 13 - 0
src/templates/textdocs/version_pdf.html

@@ -41,6 +41,19 @@
         p {
             text-align: justify;
         }
+
+        /* --- ADD THIS BLOCK --- */
+        /* Forces WeasyPrint to respect the width/height set by TinyMCE */
+        img[width] {
+            width: attr(width px);
+        }
+        img[height] {
+            height: attr(height px);
+        }
+        img {
+            max-width: 100%;
+            height: auto;
+        }
     </style>
 </head>
 <body>