Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Sat Apr 19, 2025 12:57 am

I am using Spire.Doc version 13.3 (.NET Framework 4.0.30319).

I am using Object in an Excel file that are not intended for printing.

I expected these objects to disappear when converting to PDF, but when I converted it using Spire, they did not disappear.
In Office products, the objects disappeared when converting to PDF.

What should I do to ensure that the objects disappear when converting to PDF using Spire as well?

The objects and settings in the red box in the attached capture are the ones in question.

Attachment ① is the Excel file before conversion, and Attachment ② is the Excel file after conversion.
Last edited by sxi123123123 on Wed Jul 23, 2025 12:46 pm, edited 1 time in total.

sxi123123123
 
Posts: 29
Joined: Thu Mar 06, 2025 3:09 pm

Mon Apr 21, 2025 8:22 am

Hello,

Thank you for your inquiry.
I have converted your Excel file using the latest version of Spire.XLS Pack (Hotfix) Version:15.4.0, but cannot reproduce the issue you mentioned. Please upgrade to the latest version and retest. If the issue persists, please reply with the following details for further investigation. Thanks in advance.
1.Your current operating system information (e.g. Windows 10);
2. Your system's regional settings (e.g. English(United Kingdom)).

Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Mon Apr 21, 2025 10:46 am

Thank you for your response.

Due to our development process, it is currently difficult for us to upgrade immediately.
I understand that the issue has been resolved in the latest version, but could you confirm if it can be reproduced in Spire.Doc version 13.3 (.NET Framework 4.0.30319)?

Additionally, I have one more question.
Is there an option or API to remove the objects all when converting to PDF?

sxi123123123
 
Posts: 29
Joined: Thu Mar 06, 2025 3:09 pm

Tue Apr 22, 2025 6:44 am

Hello,

Thanks for your reply.
Please note that Spire.Doc is only used for manipulating Word files and does not support processing Excel files. Currently, the latest version of Spire.XLS does not retain shapes with the "Print Object" setting unchecked when directly converting an Excel file to PDF. Since you have not provided the version of Spire.XLS you are currently using, we are unable to investigate further whether there are alternative solutions in your current version that could meet your needs. As a suggestion, please reply with the version of Spire.XLS you are using. Additionally, you may try running the following code in your project to see if it resolves the issue, it deletes shapes in the Excel file that do not have the "Print Object" setting enabled.
Code: Select all
//Create an instance of the Workbook class
Workbook workbook = new Workbook();

//Load the Excel workbook
workbook.LoadFromFile("Source file path");
Worksheet sheet = workbook.Worksheets[0];

 for (int i = sheet.Shapes.Count - 1; i >= 0; i--)
 {
     if (!sheet.Shapes[i].IsPrintable)
     {
         sheet.Shapes[i].Remove();
     }
 }
workbook.SaveToFile("Target file path", FileFormat.PDF);

Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Thu Apr 24, 2025 3:27 pm

I apologize for the inconvenience.
I am using Spire.Office.4.2.0 (Spire.XLS version 9.2.13.18020 (.NET Framework 2.0)).

I tried to implement the sample code you provided with the above version, but the API was not available.
On the Windows server using Spire.XLS, I cannot upgrade to a version higher than ".NET Framework 2.0" due to other processing dependencies. Is there a way to resolve this?

sxi123123123
 
Posts: 29
Joined: Thu Mar 06, 2025 3:09 pm

Fri Apr 25, 2025 3:29 am

Hello,

Thanks for your reply.
Please be informed that the old version of Spire.Office 4.2.0 does not include the above functions and there is no other solution. We recommend that you download the latest Spire.Office Platinum (Hotfix) Version: 10.2.0 , which supports the NET2.0 platform and can meet your needs. After decompression, please manually import Spire.XLS.dll from the "BIN\NET2.0" folder. If you have other questions, please feel free to contact us.

Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Wed Apr 30, 2025 2:35 am

Thank you for your response.

Since it is difficult to upgrade the Spire version, I am considering alternative solutions.

I am thinking about implementing a process to check whether the target file contains any objects before converting to PDF.

Does the following version have such functionality implemented?

■ Spire.Office.4.2.0 (version that runs on .Net2.0)
・Spire.XLS: 9.2.13.18020
・Spire.DOC: 7.2.6.18020

Also, in the case of Excel, is it possible to exclude objects that are placed outside the print area from the check?

The area outside the print area refers to the area outside the blue frame in the attached document.
Last edited by sxi123123123 on Wed Jul 23, 2025 12:47 pm, edited 1 time in total.

sxi123123123
 
Posts: 29
Joined: Thu Mar 06, 2025 3:09 pm

Wed Apr 30, 2025 9:57 am

Hello,

Thank you for your feedback.
Sorry, the Excel file contains a large number of objects. Currently, our Spire.Xls cannot obtain all of them in some way. As a suggestion, you can further subdivide your needs and tell us the type of objects you want to obtain so that we can provide further assistance. Thank you for your understanding.

Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Thu May 01, 2025 1:43 am

I apologize for the inconvenience. I would like to check the shape objects that can be inserted in the red box area of the attached capture. Is there a feasible method to do this?
Last edited by sxi123123123 on Wed Jul 23, 2025 12:47 pm, edited 1 time in total.

sxi123123123
 
Posts: 29
Joined: Thu Mar 06, 2025 3:09 pm

Thu May 01, 2025 6:56 am

Hello,

Thanks for your feedback.
Actually, we have already provided you with the code to retrieve the shape object before. However, due to your low version, the previous code cannot be used. Unfortunately, we regret to inform you that currently your requirements can only be met through an upgraded version. Thanks for your understanding.

Sincerely,
William
E-iceblue support team
User avatar

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

Thu May 08, 2025 11:11 am

Thank you very much.

We tried Spire.Office Platinum (Hotfix) Version: 10.2.0, but it resulted in an error on Visual Studio2008.
The attached Spire.png is a screenshot taken when attempting to reference Spire.Office.4.2.0,
and the attached Spire_new.png is a screenshot taken when attempting to reference Spire.Office.10.2.0.

In Spire_new.png, an error occurs while loading the Spire.XLS module.

All four types of DLLs included in Spire.Office.10.2.0 were not working:
・For net6.0
・For net40
・For net48
・For netcoreapp2.0

Is there a possible cause or a solution to this issue?
Last edited by sxi123123123 on Wed Jul 23, 2025 12:47 pm, edited 1 time in total.

sxi123123123
 
Posts: 29
Joined: Thu Mar 06, 2025 3:09 pm

Fri May 09, 2025 7:50 am

Hello,

Thanks for your inquiry.
Please import the Spire.XLS.dll file from the folder shown in the screenshot. If the problem persists, please reply to let us know your application type, e.g. Console Application (.Net Framework 4.5). Please provide us with a simplified project that reproduces your issue. Thanks in advance.

Sincerely,
Tommy
E-iceblue support team
Attachments
setting.png
setting.png (5.99 KiB) Viewed 58 times
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Mon May 12, 2025 4:09 am

Thank you very much.

We installed Spire.Office.10.2.0 using the NuGet command, but the folder or module for Net2.0 was not included.

Could you please let us know where the specified folder or module can be found? Also, how should we go about installing it?

Thank you for your assistance.

sxi123123123
 
Posts: 29
Joined: Thu Mar 06, 2025 3:09 pm

Mon May 12, 2025 9:17 am

Hello,

Thank you for your feedback.
Sorry, for Net2.0 platform, direct installation via Nuget is no longer supported. You need to download Spire.Office 10.2.0 first, then unzip it, and finally import Spire.XLS.dlll from the NET2.0 folder into your project. If you have any questions, please feel free to write to back.

Sincerely,
Tommy
E-iceblue support team
User avatar

Tommy.Tang
 
Posts: 85
Joined: Mon Apr 21, 2025 7:05 am

Fri May 16, 2025 9:49 am

Thank you very much.

I downloaded the version you provided and confirmed that the issue has been resolved.

I have an additional question regarding the license.
We have contracted one Developer OEM Subscription license each for Spire.XLS for .NET and Spire.Doc for .NET (a total of 2 licenses).
Is it permissible under the license to deploy different versions of Spire on different servers as follows?

Server 1
 Spire.XLS 15.1.3.0
 ⇒ .NET Framework 4.0

Server 2
 Spire.Office 10.2.0
  Spire.XLS: 15.2.6.5020
  Spire.Doc: 13.2.3.3020
 ⇒ .NET Framework 2.0

As we are in the final stages of the testing phase for development,
I would like to limit the impact by only upgrading one server, so I want to confirm if operating with different versions is acceptable.

If there is a different contact for this inquiry, could you please provide the correct address?

sxi123123123
 
Posts: 29
Joined: Thu Mar 06, 2025 3:09 pm

Return to Spire.XLS

cron