We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Styling/Other problems after upgrading from v4.7 to v7.6

We recently upgraded from v4.7 to v7.6 for Aspose PDF API. As a result we had to use Aspose.Pdf.Generator.Pdf class instead of Aspose.Pdf.Pdf. This is the only change that we did in our code. Since then we are facing a lot of issues in our exports.


The common problems are:-
  1. tables getting cutt-off from left and right, due to large width (maybe because text is not getting wrapped for some columns, being the real issue)
  2. no outer border for some tables
  3. etc.
As i mentioned the only change that we did is that we are now using the new class, what could be the issue?

FYI we had a similar issue with Aspose.Cells. In the new version, we don’t have the Style property but need to use GetStyle() and SetStyle() methods.
see Styling problems after upgrading from v 4.8 to 7.3

In older version we were using
cell1.Style.ForegroundColor = Color.Red;

In new version, because Style property was not available when we used the method as -
cell1.GetStyle().ForegroundColor = Color.Red;

it didnt produce the same results. We had to do some additional task like this -
Style tempStyle = cell1.GetStyle();
tempStyle.ForegroundColor = Color.Red;
cell.SetStyle(tempStyle);

Kindly look into it and provide your inputs. What do we need to change to make it work like he older class.
Vibhor Agarwal:
We recently upgraded from v4.7 to v7.6 for Aspose PDF API. As a result we had to use Aspose.Pdf.Generator.Pdf class instead of Aspose.Pdf.Pdf. This is the only change that we did in our code. Since then we are facing a lot of issues in our exports.

The common problems are:-
  1. tables getting cutt-off from left and right, due to large width (maybe because text is not getting wrapped for some columns, being the real issue)
  2. no outer border for some tables
  3. etc.
As i mentioned the only change that we did is that we are now using the new class, what could be the issue?
Hi Vibhor,

Thanks for contacting support.

Can you please share some code snippet/project which can help us in replicating this issue.

Vibhor Agarwal:
FYI we had a similar issue with Aspose.Cells. In the new version, we don’t have the Style property but need to use GetStyle() and SetStyle() methods.

In older version we were using
cell1.Style.ForegroundColor = Color.Red;

In new version, because Style property was not available when we used the method as -
cell1.GetStyle().ForegroundColor = Color.Red;

it didnt produce the same results. We had to do some additional task like this -
Style tempStyle = cell1.GetStyle();
tempStyle.ForegroundColor = Color.Red;
cell.SetStyle(tempStyle);

Kindly look into it and provide your inputs. What do we need to change to make it work like he older class.
I have asked my fellow worker from Aspose.Cells team to further look into the details of this issue. Soon you will be updated with the status of correction. We are sorry for your inconvenience.

Hi,


Well, I think we have already sorted out your doubts and issues in your other thread for Aspose.Cells:
Styling problems after upgrading from v 4.8 to 7.3

FYI, in the new versions you cannot directly update the formatting by using the single line i.e.:
cell.GetStyle().ForegroundColor = (Color)colorConverter.ConvertFromString("#dce9f0");
so, you have to first get the style of the cell, then update the formatting and then apply the style to the cell (all in three steps) accordingly. Although it adds some extra lines to the code but it would be fruitful to do it as we have eliminated the older Cell.Style property in the new versions and replaced it with Cell.GetStyle()/SetStyle approach which is more efficient and better regarding performance grounds.


In case, you still have any any confusion regarding Aspose.Cells, let us know in the above thread. We will help you soon there.

Regarding issues for Aspose.Pdf, please provide Nayyer details and sample codes etc. to reproduce the issue, he will help you soon here.

Thank you.

Hi,


Creating a sample code project takes a lot of time as the original code has a lot of dependencies, parameters that come from different places in the application. Plus there are a lot of our own classes that are being used in the methods where we use Aspose.

If you people know some problems that can arise because of changing Aspose.Pdf.Pdf to Aspose.Pdf.Generator.Pdf, it will be of great help.
The main issue that persists is that the text in table cells used to come wrapped before, but now the column expands according to the text.

Like in the case of Aspose.Cells, we just changed the Aspose.Style property to Aspose.GetStyle() ans Aspose.SetStyle() and the styling got disturbed.
It was because GetStyle() works differently that Style property.

Do we have a similar case in Aspose.Pdf.Generator. Maybe you have some other posts from other users who have encountered this problem.
This will save a lot of my time.

Forgot to mention that all classes that were a part of Aspose.Pdf namespace and are now a part of Aspose.Generator have been changed.

Vibhor Agarwal:
If you people know some problems that can arise because of changing Aspose.Pdf.Pdf to Aspose.Pdf.Generator.Pdf, it will be of great help.
The main issue that persists is that the text in table cells used to come wrapped before, but now the column expands according to the text.
Hi Vibhor,

I am afraid until or unless we have able to replicate/test the scenario at our end, we might not be able to figure out the actual reasons of the issue which you have been facing. Recently there have been some cases where some customers have noticed some issues while rendering contents in table cells but from time to time, we keep on resolving such problems. We are sorry for this inconvenience.
Vibhor Agarwal:
Forgot to mention that all classes that were a part of Aspose.Pdf namespace and are now a part of Aspose.Generator have been changed.
Hi,

All the classes and enumerations of legacy Aspose.Pdf for .NET are available under Aspose.Pdf.Generator namespace. If you are facing issues while accessing any classes, please share some details.