Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Jan 29, 2025 9:41 am

Hello,

I am using Spire.Office 7.11.0.
When i try to load .pdf file from stream, or even from file i get an error "Invalid/Unknown/Unsupported format".
I only get that error when i try to load that one file that has layers. Can send it privately if needed.

Code i use is:

Code: Select all
Spire.Pdf.PdfDocument pdfDocument = new PdfDocument();      
pdfDocument.LoadFromFile("pathToFile");


or


Code: Select all
Spire.Pdf.PdfDocument pdfDocument = new PdfDocument();      
pdfDocument.LoadFromBytes(byteArray);


Is there a workaround for this?

Best regards

mcap1234
 
Posts: 6
Joined: Thu Oct 05, 2023 2:46 pm

Thu Jan 30, 2025 1:53 am

Hello,

Thank you for your letter. Our latest version is Spire.Office Platinum(Hotfix) Version:10.1.0, which includes more new features and bug fixes. Based on your situation, we suggest that you use this latest version to test again. If the error still persists, please provide your input PDF for further investigation. You can attach your file here or send it to us via email ([email protected]).

And for the latest version, please use the following code to apply the license key.
Code: Select all
//Spire.Doc version 11.5.6 or above
Spire.Doc.License.LicenseProvider.SetLicenseKey("your license key");
//Spire.XLS  version 13.6.0 or above
Spire.Xls.License.LicenseProvider.SetLicenseKey("your license key");
//Spire.PDF version 9.6.0 or above
Spire.Pdf.License.LicenseProvider.SetLicenseKey("your license key");
//Spire.Presentation version 8.6.0 or above
Spire.Presentation.License.LicenseProvider.SetLicenseKey("your license key");

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Thu Jan 30, 2025 8:52 am

I am still getting an error, even on latest version. I've sent you file on provided e-mail.

Thank you

mcap1234
 
Posts: 6
Joined: Thu Oct 05, 2023 2:46 pm

Thu Jan 30, 2025 10:14 am

Hello,

Thank you for sharing the document, but I have tested it without any issues. What is your project framework?

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Thu Jan 30, 2025 10:56 am

I am using .NET Core 6.0.

Code: Select all
<PropertyGroup>
  <TargetFramework>net6.0</TargetFramework>
</PropertyGroup>


Code: Select all
<PackageReference Include="Spire.Office" Version="10.1.0" />

mcap1234
 
Posts: 6
Joined: Thu Oct 05, 2023 2:46 pm

Fri Jan 31, 2025 9:11 am

Hello,

Thanks for providing more information.
Sorry, we still haven't reproduced the issue you mentioned. I noticed that your IDE doesn't seem to be Visual Studio 2022, we tested it on Visual Studio 2022. For the convenience of our further investigation, please reply and let us know the IDE tool you are using. Or provide us with a project that can reproduce your problem, thank you in advance.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Fri Jan 31, 2025 11:51 am

using version 7.12.4 fixed problem

mcap1234
 
Posts: 6
Joined: Thu Oct 05, 2023 2:46 pm

Tue Feb 04, 2025 8:23 am

Hello,

Thanks for your inquiry.
If version 7.12.4 has no issues, then the latest version 10.1.0 should also be fine. Currently, we are not entirely clear about the cause of your problem. If you need to upgrade to the latest version, please let us know the name of the IDE tool you are using, and we will investigate further.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.PDF