webgio / Rotativa

Rotativa, /rota'tiva/. Make Pdf from Asp.Net MVC. Available on Nuget https://www.nuget.org/packages/Rotativa
http://letsfollowtheyellowbrickroad.blogspot.it/search/label/Rotativa
MIT License
621 stars 224 forks source link

Sometimes the pdf is empty #237

Open JacopoDEV-ITA opened 1 year ago

JacopoDEV-ITA commented 1 year ago

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(); } }