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

Free Support Forum - aspose.com

Legend merging above the table in PDF

Hi Team,

The legend displayed in chart gets overlapped with the table below the chart area in PDF format.

In Excel it is displayed correctly.

Can you please help us in fixing the issue.

I have attached both excel and PDF files.

Hi Prabu,


Thank you for sharing the sample spreadsheet.

Please try this case against the latest version of Aspose.Cells for Java 8.7.1 as it produces correct result (attached). In case the problem persists, please provide an executable sample application along with its result to show the problem.

Java

Workbook book = new Workbook(dir + “LEGOREP04.XLSX”);
book.save(dir + “output.pdf”);

Hi Team,

We tested it using aspose-cells-8.7.1 jar and its not working.
Can you please help us with some other alternate solution.

Hi again,


We are sorry to know that the latest version of Aspose.Cells for Java 8.7.1 hasn’t resolved the said problem on your side. In order to further investigate the matter, please provide us the PDF generated against the latest release along with environment details as follow.

  • Operating system version & architecture.
  • JDK vendor, version & architecture.
  • JVM arguments set for process/program, if any.

Hi Team,

Our operating system is Windows 7 and 32-bit

Our JDK version is jdk1.7.0_45 and JDK vendor is Oracle Corporation

No we are not setting any JVM arguments for the process/program

Hi,


Thank you for the details. Please also provide the PDF generated with latest version of Aspose.Cells for Java 8.7.1.2 (attached) which we require to identify the problem cause.

Hi Team,

Please find the PDF attached with latest version of Aspose.Cells for Java 8.7.1.2 .

I have attached the excel too to show the table hidden below graph in PDF.

Hi Prabu,


I am afraid, I have to ask you again to share the PDF (not its snapshot) as we need to review certain document properties (PDF Producer, Fonts) to isolate the problem cause. Moreover, I have repeatedly tested the scenario on different platforms against the releases v8.7.1 & v8.7.1.2, and I am getting the correct results every time. Attached is the PDF generated on Windows 7 Home Premium against Aspose.Cells for Java 8.7.1.2 and JDK 7u79.

In order to move forward with the investigation, please share the PDF file generated with Aspose.Cells for Java 8.7.1.2 (download link shared earlier).

Hi Team,

We have shared the PDF here.

Hi Prabu,


Your sample PDF has been generated with some other tool by the name RAD PDF and not with Aspose.Cells for Java APIs. Please check attached snapshot.

Just for clarification, could you please state, have you tried the latest revision of the Aspose.Cells for Java 8.7.1.2 against this issue? If yes, you must have the resultant PDF. If not, please download the latest jar file from here, extract the archive and reference the jar in your sample project before executing it to generate the PDF. Once you have the result on disc, please attach it here for investigation.

Hi Team,

We have generated PDF and PPT with Aspose.Cells for Java 8.7.1.4 which was the latest jar shared with us.

Inspite of that we are not able to achieve the desired results.

Please look into the attachments with this reply and help us in fixing the issue.

Thanks.

Hi Prabu,


Thank you for sharing the PDF. You have changed your input spreadsheet this time. Please check the attached comparison of previously shared spreadsheet and recently shared PDF. Please provide us the spreadsheet which you are using to evaluate the case. Please also highlight the problematic areas in PDF as compared to spreadsheet view in Excel so we could focus on those areas while evaluating the case.

Hi Team,

We have attached the spreadsheet for your reference.

Please look into it and provide us solution.

Thanks in advance.

Hi Prabu,


Thank you for sharing the sample spreadsheet.

I have performed tests on my side while using the latest version of Aspose.Cells for Java 8.7.1.4 with the simplest code as provided at the end of this post however, I am not able to replicate the said issue on my side (please check attached resultant PDF). Please note, the tests were executed on Windows 7 & Windows 10 against JDK 1.7.0_65 & 1.8.0_66 respectively. Please spare me more time to discuss the matter with concerned member of the product team and perform more tests on other platforms. In the meanwhile, please share the code snippet that you are currently using for the said conversion. If possible, please test the conversion on some other machine and let us know the outcome.

Your help is highly appreciated in troubleshooting this scenario.

Java

new Workbook(“C:/temp/rep04+spreadsheet.xlsx”).save(“C:/temp/rep04+spreadsheet.pdf”, SaveFormat.PDF);

Hi,

Thanks for your posting and using Aspose.Cells.

We are unable to replicate this issue on different environments. Lately we tested it on Windows 7-64 bits, JDK 1.7. We have attached the output pdf for your reference.

Could you please run the following code at your end and share the output PDF? Please share your original code with us which you are running at your end. It will help us investigate this issue further.

Java

String filePath = “D:\Downloads\rep04+spreadsheet.xlsx”;

Workbook wb = new Workbook(filePath);
wb.save(filePath + “.out.pdf”);

Hi Team,

We are not able to get the desired results for PDF when it is integrated with web application which runs on UNIX server.

As a standalone application it is working fine.

I have attached the code piece with this reply.

public void exportPPTX(OutputStream outputStream)
throws Exception
{
Worksheet worksheet = getWorkbookDesigner().getWorkbook().getWorksheets().get(SHEET_NAME_CHART);
worksheet.freezePanes(2,2,41,31);
setOleExcelEndRow(42);
setOleExcelEndColumn(31);
setPptHorizontalResolution(300);
setPptVerticalResolution(300);
super.exportPPTX(outputStream);
}

Thanks in advance.

Hi Prabu,


We were trying to replicate the issue on Windows based platform as stated here. You have never mentioned that the said problem is reproducible in Unix environment only. Please note, on non-Windows based platforms you have to set the folder location containing the TTF/TTC fonts used in the spreadsheet in order to get the best results. If you do not set the font directory or API is not able to find the required fonts then the API will not be able to correctly calculate the glyph dimensions, as a consequence the row height and column widths may change. Please go through these articles for better understanding on how Aspose.Cells for Java API uses the TrueType fonts.

Coming back to the original problem, I humbly request to you please provide the following details for investigation. Please note, we are asking these details again because we were under the assumption that you are performing all tests on Windows based platform. Moreover, your provided code snippet is not complete and we cannot inject the missing parts due to the complexity of the Aspose.Cells APIs.

We need the following information/artifacts to reproduce the problem on our side.

  1. Unix/Linux flavor, version & architecture
  2. JDK type, version & architecture
  3. JVM arguments, if any
  4. We need an executable sample application covering your complete scenario in perspective of Aspose APIs. It would be appropriate that you should create a simple console application that replicates the problem in non-Windows based platform such as Unix/Linux. A simple Java class should suffice if it is complete and does not have compilation errors. Try not to use 3rd party APIs in order to keep it simple. Moreover, if you are importing data from any database, you should create the data source dynamically so that database connectivity isn’t required while testing the scenario on our side.
  5. Source spreadsheet, if different than what you have already shared in this thread.
  6. Resultant PDF generated with the sample application as mentioned in point 4) while using the latest version of Aspose.Cells for Java 8.7.1.4.

As soon as you provide the complete details we will re-initiate the investigation to assist you with this incident.

Hi again,


This is to inform you that we have reevaluated the presented scenario on CentOS 6.5 x64 against JDK 1.7 & Aspose.Cells for .NET 8.7.1.4 while using the simplest code snippet provided at the bottom of this post. Please note, we are not able to replicate the issue with or without setting the font directory in code, that suggests the problem may not be related to the availability of the fonts, however, it is best to set the font directory containing the TTFs of Calibri & Arial font families (for provided spreadsheet) in order to get the best rendering results. Attached to this post are two PDF files for your reference, one was generated without fonts and other was with Calibri & Arial fonts available to the API. You can clearing observe that the legend is not overlapping the data rows in both PDF files. In case you see any problem with aforementioned PDF files then please feel free to raise your concerns.

In order to move forward with the investigation on said issue, we need you to provide the information as requested in my previous response. Most importantly, we need to review you complete code by executing it on our side.

Java

System.setProperty(“Aspose.Cells.FontDirExc”, dir + “fonts”);
new Workbook(dir + “/rep04+spreadsheet.xlsx”).save(dir + “/rep04+spreadsheet.xlsx(fonts).pdf”, SaveFormat.PDF);