Rotativa icon indicating copy to clipboard operation
Rotativa copied to clipboard

Sometimes the pdf is empty

Open JacopoDEV-ITA opened this issue 2 years ago • 0 comments

Hello, I'm using the latest version of Rotativa (1.7.3) and I'm facing this issue: both in debug that in production, sometimes the exported pdf is empty. The structure of the page is there but all of the text is missing (take a look at the following image).

image

The weirdest part of this issue is that is not consistent: sometimes it happens, other times the pdf is fine.

Here's a snippet of my code:

public ActionResult ExportQuestionnaire(int assignmentID) { var questionnaire = db.AssignedQuestionnaires.Find(assignmentID); if (questionnaire != null) { FillQuestionnaireViewModel vm = new FillQuestionnaireViewModel(questionnaire); string filename = "questionnaire.pdf"; ViewBag.PDFExport = true; return new ViewAsPdf("FillQuestionnaire", vm) { FileName = filename }; } else { return new HttpNotFoundResult(); } }

JacopoDEV-ITA avatar May 25 '23 10:05 JacopoDEV-ITA