Closed Usouf closed 5 months ago
When I use the library as a standalone it works fine and all. But when I use it in Django, it saves weirdly.
The standalone one:
The Django one:
This is my code:
def _fill_form(self, application): import requests from fillpdf import fillpdfs from django.core.files import File from io import BytesIO from django.forms.models import model_to_dict ctx = model_to_dict(application) response = requests.get("http://localhost:8000/static/document/form.pdf") if not response.ok: log.error("couldn't get form") in_stream = BytesIO(response.content) out_stream = BytesIO() fillpdfs.write_fillable_pdf( in_stream, out_stream, ctx, flatten=True ) application.arabic_document.save("Some fillpdf file.pdf", File(out_stream))
the issue was caused by the browser I was opening the pdf from. If you install a plugin that renders Arabic text it should work fine.
When I use the library as a standalone it works fine and all. But when I use it in Django, it saves weirdly.
The standalone one:
The Django one:
This is my code: