/// <summary> /// PDFs the file exists. /// </summary> /// <param name="recipient">The recipient.</param> /// <param name="reportRockStatementGeneratorStatementsTemporaryDirectory">The report rock statement generator statements temporary directory.</param> /// <returns></returns> internal static bool PdfFileExists(this FinancialStatementGeneratorRecipient recipient, string reportRockStatementGeneratorStatementsTemporaryDirectory) { var filePath = recipient.GetPdfDocumentFilePath(reportRockStatementGeneratorStatementsTemporaryDirectory); if (File.Exists(filePath) && PdfReader.TestPdfFile(filePath) != 0) { return(true); } return(false); }
/// <summary> /// Gets the PDF document. /// </summary> /// <param name="financialStatementGeneratorRecipientResult">The financial statement generator recipient result.</param> /// <param name="reportRockStatementGeneratorStatementsTemporaryDirectory">The report rock statement generator statements temporary directory.</param> /// <returns></returns> internal static PdfDocument GetPdfDocument(this FinancialStatementGeneratorRecipient recipient, string reportRockStatementGeneratorStatementsTemporaryDirectory) { var filePath = recipient.GetPdfDocumentFilePath(reportRockStatementGeneratorStatementsTemporaryDirectory); if (File.Exists(filePath)) { return(PdfReader.Open(filePath, PdfDocumentOpenMode.Import)); } return(null); }