Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import pdf file error #190

Open
ziheng-dev opened this issue Oct 18, 2024 · 1 comment
Open

Import pdf file error #190

ziheng-dev opened this issue Oct 18, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request forum Please use Discussions or the Support forum to ask Support questions - https://forum.pdfsharp.net/

Comments

@ziheng-dev
Copy link

I am using the PDFsharp 6.2.0 Preview 1 in a .net 8 project.

It shows me this error "Stream cannot be read. Please send us the PDF file so that we can fix this (issues (at) pdfsharp.net)." when I try to import this pdf file.

TS-18_0001.pdf

this is part of my code:

var pdfBytes = File.ReadAllBytes(filePath);
using (var readMemoryStream = new MemoryStream(pdfBytes))
{
PdfDocument inputDocument = PdfReader.Open(readMemoryStream, PdfDocumentOpenMode.Import);
}

please help to check, Thanks.

@ThomasHoevel
Copy link
Member

The file is corrupted.
Adobe Reader can fix it (try File / Save as).
PDFsharp cannot yet fix it.

@ThomasHoevel ThomasHoevel added enhancement New feature or request forum Please use Discussions or the Support forum to ask Support questions - https://forum.pdfsharp.net/ labels Oct 21, 2024
@ThomasHoevel ThomasHoevel added the duplicate This issue or pull request already exists label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request forum Please use Discussions or the Support forum to ask Support questions - https://forum.pdfsharp.net/
Projects
None yet
Development

No branches or pull requests

2 participants