Serve pre-rendered PDF as static file for instant download
All checks were successful
Build and Deploy Erika CV / build-and-deploy (push) Successful in 1m10s
All checks were successful
Build and Deploy Erika CV / build-and-deploy (push) Successful in 1m10s
- Render PDF once with WeasyPrint, save to static/Erika_Nielsen_CV.pdf - Change download button from WeasyPrint route to direct static file link - Faster download, no server-side rendering on each click
This commit is contained in:
BIN
static/Erika_Nielsen_CV.pdf
Normal file
BIN
static/Erika_Nielsen_CV.pdf
Normal file
Binary file not shown.
@@ -384,6 +384,8 @@
|
|||||||
box-shadow: 0 4px 20px rgba(74, 143, 232, 0.5);
|
box-shadow: 0 4px 20px rgba(74, 143, 232, 0.5);
|
||||||
transition: background 0.2s, transform 0.1s;
|
transition: background 0.2s, transform 0.1s;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.pdf-btn:hover { background: #2f72d0; transform: scale(1.04); }
|
.pdf-btn:hover { background: #2f72d0; transform: scale(1.04); }
|
||||||
|
|
||||||
@@ -732,7 +734,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if not pdf_mode %}
|
{% if not pdf_mode %}
|
||||||
<button class="pdf-btn" onclick="window.location='/download'">⬇ Download CV som PDF</button>
|
<a class="pdf-btn" href="/static/Erika_Nielsen_CV.pdf" download="Erika_Nielsen_CV.pdf">⬇ Download CV som PDF</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user