TextBox.IsPrintable Always Returns True

I am trying to convert a spreadsheet with some textboxes to PDF. I want the PDF file to only have the textboxes that are printable. In order to do this, I am checking the IsPrintable property of each textbox and removing the ones that are not printable. But IsPrintable is true for all the textboxes even the ones that are non printable in excel.

Is there another way of doing this?

Thanks.

Hi,


Could you provide us the template Excel file containing your sample data and text boxes, also paste your sample code here to show the issue. We will conduct the test for your issue to render your template Excel file to PDF using your sample code to confirm the issue.

Also, by the way, you may use TextBoxCollection.RemoveAt() to remove the unwanted text boxes before rendering to PDF format.

Thank you.

I have attached an excel file that I have been using and the resultant PDF file that I get using the following code:


Workbook workbook = new Workbook(“TestFile.XLSX”);
ClearTextBoxes(workbook.Worksheets[0]);
workbook.Save(“TestFile.PDF”, SaveFormat.Pdf);

private static void ClearTextBoxes(Worksheet worksheet)
{
int totalCount = worksheet.TextBoxes.Count;
for (int i = totalCount - 1; i >= 0; i–)
{
if (!worksheet.TextBoxes[i].IsPrintable)
{
worksheet.TextBoxes.RemoveAt(i);
}
}
}

TextBoxCollection.RemoveAt() is exactly what I am trying to do.

Thanks.

Hi,


Thanks for the template files.

I have tested your issue by converting the template Excel file to PDF. The second text box should not be rendered, but it does. I have logged a ticket with an id “CELLSNET-41851” for your issue. We will look into your issue soon.

Once we have any update on it, we will let you know here.

Thank you.


Thanks. Please let me know as soon as you get a fix. I need to use this feature in my current project.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have fixed the issue.

Please download and try this fix: Aspose.Cells for .NET v7.5.1.2 and let us know your feedback.

Thanks. This seems to be working fine.


When will this version be available via NuGet?

Hi,


Well, we publish official releases of the product only to NuGet repository. We do not publish hot fixes that are posted into the forums for the users. Well, you may use this fix (v7.5.1.2) without any problem, it will behave like an official release and you may use it on production server, it includes all the functionality and fixes of official release i.e. v7.5.1 till that fix.

However, our next official release of the product (e.g v7.5.2) that is scheduled to be released in the mid of next month (August 2013), it will include all the previous fixes including this one (v7.5.1.2) too. After releasing that product, we will publish that version on NuGet too.

Thank you.

The issues you have found earlier (filed as CELLSNET-41851) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.