def get_pdf_poster(location, lang='en'):
    qr_code = get_signed_qrcode(location)
    poster_template = 'register/posters/{lang}.svg'.format(lang=lang)
    address_details = '{city}, {province} {postal_code}'.format(city=location.city, province=location.province, postal_code=location.postal_code)
    rendered = render_to_string(poster_template, {'qr_code': qr_code, 'name': location.name, 'address': location.address, 'address_details': address_details})
    buffer = io.BytesIO()
    cairosvg.svg2pdf(bytestring=rendered.encode('UTF-8'), write_to=buffer, output_width=815)
    BASE_DIR = os.path.dirname(os.path.dirname(__file__))
    instructions = os.path.join(BASE_DIR, 'register/templates/register/posters/instructions-{lang}.pdf'.format(lang=lang))
    pdf_instructions = PyPDF2.PdfFileReader(instructions)
    mergeFile = PyPDF2.PdfFileMerger()
    mergeFile.append(pdf_instructions)
    mergeFile.append(buffer)
    mergeFile.write(buffer)
    buffer.seek(0)
    return buffer
def get_pdf_poster(location, lang='en'):
    qr_code = get_signed_qrcode(location)
    poster_template = 'register/posters/{lang}.svg'.format(lang=lang)
    address_details = '{city}, {province} {postal_code}'.format(city=location.city, province=location.province, postal_code=location.postal_code)
    rendered = render_to_string(poster_template, {'qr_code': qr_code, 'name': location.name, 'address': location.address, 'address_details': address_details})
    buffer = io.BytesIO()
    cairosvg.svg2pdf(bytestring=rendered.encode('UTF-8'), write_to=buffer, output_width=815)
    BASE_DIR = os.path.dirname(os.path.dirname(__file__))
    instructions = os.path.join(BASE_DIR, 'register/templates/register/posters/instructions-{lang}.pdf'.format(lang=lang))
    pdf_instructions = PyPDF2.PdfFileReader(instructions)
    mergeFile = PyPDF2.PdfFileMerger()
    mergeFile.append(pdf_instructions)
    mergeFile.append(buffer)
    mergeFile.write(buffer)
    buffer.seek(0)
    return buffer