Posted 15 May 2026, 9:20 am EST
Hello,
Some users are recently reporting that they are having issues while saving reports generated through C1PrintDocument in PDF format.
The error is “Unable to read beyond the end of the stream”, and at the moment it has been reported from users with Windows running with French or Hebrew settings, and this issue started to happen recently without any update of the code or dlls involved at our end.
This issue is not happening from our tests in different systems and folders, however the problem is being reported from different users but we are not able to test it directly.
The .dll version (C1Document, C1PrintPreview and other dlls) is currently 4.8.2024.1.672 and we never encountered this issue before.
The code involved is:
Dim exPdf As C1.C1Preview.Export.PdfExporter = C1.C1Preview.Export.ExportProviders.PdfExportProvider.NewExporter
exPdf.Document = PrintDocument
exPdf.ShowOptions = False
exPdf.Export(pathExportPDF)
This procedure is called after the report is already generated and correctly visualized.
We also tried to add this code in case of error to test within those users, but it does not work:
Using ms As New MemoryStream()
exPdf.Export(ms)
ms.Position = 0
Using fs As New FileStream(pathExportPDF, FileMode.Create, FileAccess.Write)
ms.CopyTo(fs)
End Using
End Using
We did check with this users their permissions as well as folder selected, but this seems not to be a problem because they are able to save other file in those foldrs and also to export the same report as xls without issues (using C1.C1Preview.Export.XlsExporter).
Also, with one user we were able to click on “Print” button on the C1PrintPreview and to print as pdf without issues, however clicking on “Save” and trying to save as pdf always gave the same error.
Can you provide assistance with this issue? Are there any suggestion or alternatives to save as pdf?
Thanks!
