The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Generate PDF version of the resume

Gergely Polonkai 9 years ago
parent 6c2b7873c2
commit cf08e3e0e4
  1. 6
  2. 12
  3. 1
  4. 17

@ -1,9 +1,9 @@
{% extends 'front_base.html' %}
{% extends pdf|yesno:'resume_pdf.html,front_base.html' %}
{% block title %} - Resume{% endblock %}
{% block content %}
<h3>Resume <span id="keywords-button">[ want some keywords only? click this! ]</span></h3>
<h3>Resume{% if not pdf %} <span id="keywords-button">[ want some keywords only? click this! ]</span>{% endif %}</h3>
<div itemscope itemtype="">
<p>I am <span class="b" itemprop="name">Gergely Polonkai</span> (sometimes referred to as <span itemprop="nickname">W00d5t0ck</span> or <span itemprop="nickname">Polesz</span>), a <span class="b" itemprop="jobTitle">software developer, systems engineer and administrator</span>. I was born on <span class="b" itemprop="birthDate">7 March, 1983</span> in Budapest, Hungary. I spent my life moving here-and-there in the country, and finally settled in <span class="b" itemprop="address" itemscope itemtype=""><span itemprop="locality">Budapest</span></span>. Although I have already found my mate for life, I am <span class="b">single</span> yet (living in a common-law marriage), being the proud father of a son and a daughter.</p>
@ -20,7 +20,7 @@
<div id="keywords"><span id="keywords-close"></span><span id="keywords-list"></span></div>
<div id="page-disclaimer">You can download the latest version of my resume at <a href="http://{{ site.domain }}{% url "basics:resume" %}">http://{{ site.domain }}{% url "basics:resume" %}</a>.</div>
<div id="page-disclaimer">You can download the latest version of my resume at <a href="http://{{ site.domain }}{% url "basics:resumepdf" %}">http://{{ site.domain }}{% url "basics:resumepdf" %}</a>.</div>
<script type="text/javascript">
Array.prototype.unique = function() {

@ -0,0 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<title>Gergely Polonkai - Resume</title>
<meta name="generator" content="ViM" />
<meta name="author" content="Gergely Polonkai" />
{% block content %}{% endblock %}

@ -3,6 +3,7 @@ from basics import views
urlpatterns = patterns('',
url(r'^resume$', views.resume, name = 'resume'),
url(r'^resume.pdf$', views.resumepdf, name = 'resumepdf'),
url(r'^about$', views.about, name = 'about'),
url(r'^disclaimer$', views.disclaimer, name = 'disclaimer'),

@ -1,10 +1,27 @@
from django.shortcuts import render
from django.contrib.sites.models import get_current_site
from django.http import HttpResponse
from django.template.loader import render_to_string
from StringIO import StringIO
from xhtml2pdf import pisa
def googlevalidator(request):
return HttpResponse('')
def resumepdf(request):
body = render_to_string('basics/resume.html', { 'site': get_current_site(request), 'pdf': True })
dst = StringIO()
pdf = pisa.CreatePDF(body, dst)
pdf_data = dst.getvalue()
if not pdf.err:
return HttpResponse(pdf_data, mimetype = 'application/pdf')
return HttpResponse('We had some errors<pre>%s</pre>' % escape(html))
return render(request, 'basics/resume.html', { 'site': get_current_site(request), 'pdf': True })
def resume(request):
return render(request, 'basics/resume.html', { 'site': get_current_site(request) })