Git Product home page Git Product logo

aspose.cells-for-java's People

Contributors

adam-skelton avatar adeelilyas2014 avatar ahmad-chishti avatar ahsaniqbalsidiqui avatar ali-salman avatar amjad-sahi avatar asjohnsonshi avatar aspose-cells-gists avatar aspose-words-gists avatar babar-raza avatar fahadadeel avatar farooqsheikhpk avatar fatimaahmed avatar imranrafique avatar iqbal-aspose avatar johnhe998 avatar masood-anwer avatar msohailismail avatar peterzhou-aspose avatar peytonxuaspose avatar rizwanniazigroupdocs avatar saqib-razzaq-aspose avatar saqibmasood avatar saqibrazzaq avatar saudaspose avatar shahzad-latif avatar shakeel-faiz avatar shoaibkhan-aspose avatar simonzhaoaspose avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aspose.cells-for-java's Issues

excel to pdf 纸张大小不一致

excel设置纸张大小21cm*9.7cm 生成pdf纸张是按A4大小的,如果设置了pdfSaveOptions.setOnePagePerSheet(true),纸张会按打印打印预览的大小,这个如何保存生成的pdf纸张和原excel一致

WorksheetToImage Error

While Converting the excel file to Image I get the error com.aspose.cells.CellsException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed. Below is my Code

                val workBook = Workbook(fileOptions.filePath)
                val imgOptions = ImageOrPrintOptions()
                imgOptions.imageType = ImageType.PNG
                imgOptions.allColumnsInOnePagePerSheet = true
                imgOptions.outputBlankPageWhenNothingToPrint = false
                val sheet: Worksheet =
                    workBook.worksheets.get(workBook.worksheets.activeSheetIndex)
                val sr = SheetRender(sheet, imgOptions)
                for (j in 0 until sr.pageCount) {
                    // Generate an image for the worksheet
                    val imageFilePath = getPngFileName(fileOptions.filePath!!, j)
                    sr.toImage(j, imageFilePath)
                    mOutputFilePaths.add(imageFilePath)

Below is the excel file attached

rase.zip

xlsx to pdf datetime conversion error

marian3.xlsx

Converting the attached file on a French computer produces incorrect PDF:

  • simply running my program (java -jar <my fat jar>) all data rows are displayed in the PDF as ######
  • however, if I run my program with the -Duser.language=fr_FR option the dates are displayed, but in English way (month/day/year) - what I want is to display them French style: day/month/year - as they are displayed by Microsoft Excel or Libre Office.

My Java code is basically this one:

Workbook workbook = new Workbook("marian3.xlsx");
int sheetCount = workbook.getWorksheets().getCount();
for (int s = 0; s < sheetCount; s++) {
            Worksheet sheet = workbook.getWorksheets().get(s);
            PageSetup pageSetup = sheet.getPageSetup();
            pageSetup.setLeftMargin(MARGIN_CM);  // private static final double MARGIN_CM = 0.4;
            pageSetup.setRightMargin(MARGIN_CM);
            pageSetup.setTopMargin(MARGIN_CM);
            pageSetup.setBottomMargin(MARGIN_CM);
            pageSetup.clearHeaderFooter();
}
PdfSaveOptions options = new PdfSaveOptions();
options.setOnePagePerSheet(true);
options.setCompliance(PdfCompliance.PDF_A_1_B); // NONE, PDF_A_1_A, PDF_A_1_B
options.setCustomPropertiesExport(PdfCustomPropertiesExport.STANDARD);
workbook.save("out.pdf", options);

Did I miss any option/parameter/... ?

group:merge bug

I user the method (group:merge) then it comes a bug like this
excel1
excel2

No Android Support

Hi,

I have gone through with the sample code and I need to integrate this in my android app.In aspose portal you have mentioned it as library for Android via Java but it doesn't seem support the Android.
Can you please let me know how we can use the library in android app.

Thanks,

gradle error

hi
I used the aspose cell in form of maven and it works
but now I want to merge the project with another java project using gradle (instead of maven)
but after adding the jar files downloaded from your site (from this page: https://downloads.aspose.com/cells/java), I face with this error:
error: package com.aspose does not exist
import com.aspose.cells.*
in the code I have written there is no error, but when I want to run the project (same code as the file which have worked in maven before) this error appears !

please help me!
many thanks in advance.

xlsx to pdf data visualization Error

Trying to print a Xlsx to pdf and removing all protection from excel file, the output pdf file doesn´t include the excel data

workbook = new Workbook(rutaExcel);

        vbaProject = workbook.getVbaProject();
        vbaProject.protect(false, "");
        
        WorksheetCollection worksheets = workbook.getWorksheets();
        Worksheet worksheet = worksheets.get(1);
        System.out.println("Esta protegido --> "+ worksheet.getProtection());
        
        Protection protection = worksheet.getProtection();
        



        // Restricting users to delete columns of the worksheet
        protection.setAllowDeletingColumn(false);



        // Restricting users to delete row of the worksheet
        protection.setAllowDeletingRow(false);



        // Restricting users to edit contents of the worksheet
        protection.setAllowEditingContent(false);



        // Restricting users to edit objects of the worksheet
        protection.setAllowEditingObject(false);



        // Restricting users to edit scenarios of the worksheet
        protection.setAllowEditingScenario(false);



        // Restricting users to filter
        protection.setAllowFiltering(false);



        // Allowing users to format cells of the worksheet
        protection.setAllowFormattingCell(true);



        // Allowing users to format rows of the worksheet
        protection.setAllowFormattingRow(true);



        // Allowing users to insert columns in the worksheet
        protection.setAllowInsertingColumn(true);



        // Allowing users to insert hyperlinks in the worksheet
        protection.setAllowInsertingHyperlink(true);



        // Allowing users to insert rows in the worksheet
        protection.setAllowInsertingRow(true);



        // Allowing users to select locked cells of the worksheet
        protection.setAllowSelectingLockedCell(true);



        // Allowing users to select unlocked cells of the worksheet
        protection.setAllowSelectingUnlockedCell(true);
        



        // Allowing users to sort
        protection.setAllowSorting(true);



        // Allowing users to use pivot tables in the worksheet
        protection.setAllowUsingPivotTable(true);



        // Saving the modified Excel file Excel XP format
        worksheet.unprotect();
        
        workbook.save(valorRuta, FileFormatType.XLSX);
        workbook.save(valorRutaPDF, SaveFormat.PDF);
        workbook.save(valorRutaPDF1, pdfSave);
        
        workbook1 = new Workbook(valorRuta);
        workbook1.save(rutaPDF, SaveFormat.PDF);

HiddenSheet isVisible

Hi,

I have a Excel file which contains a hidden sheet.
For each sheet in the excel file. If I check like below:
Worksheet ws = (Worksheet) worksheetObj;
if (ws.isVisible() == false) {
logger.info("Hidden sheet found {} ", ws.getName());
}

I never i get to the logger statement because even for the hidden sheet isVisible is always 0.
Can somebody help how to know If the sheet is really hidden or not.

xlxs to pdf text offset

1
2
3

this problem occurred when I changed the server,The two servers have the same fonts,the original server is ok

/**
* excel 转为pdf 输出。
*
* @param sourceFilePath excel文件
* @param desFilePathd pad 输出文件目录
*/
public static void excel2pdf(String sourceFilePath, String desFilePathd) {
if (!getLicense()) { // 验证License 若不验证则转化出的pdf文档会有水印产生
return;
}
try {
Workbook wb = new Workbook(sourceFilePath);// 原始excel路径
// Worksheet worksheet = wb.getWorksheets().get(0);
// worksheet.getPageSetup().setPaperSize(PaperSizeType.PAPER_A_4_SMALL);
// System.out.println(worksheet.getPageSetup().getPaperSize());

        FileOutputStream fileOS = new FileOutputStream(desFilePathd);
        PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
        pdfSaveOptions.setAllColumnsInOnePagePerSheet(true);
        pdfSaveOptions.setOnePagePerSheet(false);


        int[] autoDrawSheets = {3};
        //当excel中对应的sheet页宽度太大时,在PDF中会拆断并分页。此处等比缩放。
        autoDraw(wb,autoDrawSheets);

        int[] showSheets = {0};
        //隐藏workbook中不需要的sheet页。
        printSheetPage(wb, showSheets);
        wb.save(fileOS, pdfSaveOptions);
        fileOS.flush();
        fileOS.close();
        log.info(desFilePathd + "生成完毕");

    } catch (Exception e) {
        e.printStackTrace();
    }
}

Worksheet.autoFitColumns produces ugly result

I am converting an XLSX to PDF, essentially using the same code as in issue #48.

Using Worksheet#autoFitColumns() when converting the following file
example.xlsx
produces an ugly result :
example-w_autoFit.pdf
(just look at the width of the columns Cecilia, Patty, Robert and Frank).

Without autoFitColumns the result is OK :
example-normal.pdf

The code is essentially the same as in the #48 issue (#48).
I have used Aspose library 20.10 on an Ubuntu 18.04 system.

What can I do to improve the result when using autoFitColumns ?

针对excel的区域截图

原Excel,这边是不换行的
image
转换后的pdf ,换行了,
image

该怎么解决?如何才能保证格式转换后的样式一致性,以及针对excel截图的部分区域截图也会出现此情况。
劳烦看下。

excel转图片的时候,由公式生成的表格数据没有转成功

ImageOrPrintOptions imageOrPrintOptions = new ImageOrPrintOptions();
SheetRender sheetRender = new SheetRender(worksheet, imageOrPrintOptions);
sheetRender.toImage(0, “picPath“);

有什么方法,在excel转图片的时候,含有公式的表格数据也可以成功转到图片中?

转pdf时如何设置缩放参数

如标题,Microsoft Excel在打印预览时,有缩放参数【无缩放】、【将工作表调整为一页】、【将所有列调整为一页】、【将所有行调整为一页】,那使用Aspose.Cell时,如何设置这些参数

截图内容上移

项目运行在centos和ununtu上,截图生成的内容都是上移的,在windows上运行生成的截图就是正常的,这该怎么处理呢
aaa

DAYS函数计算错误

	Cell A1 = cells.get("A1");
	A1.setValue("2021-01-02 23:59:59");
	Cell B1 = cells.get("B1");
	B1.setValue("2021-01-02 00:00:00");
	String formula = "=DAYS(A1,B1)";
	Cell C1 = cells.get("C1");
	C1.setFormula(formula);
	wb.calculateFormula(true);
	System.out.println(C1.getValue());

计算结果为:1
而实际结果应该为:0

AsposeCells for Java seems to ignore fonts

Hi!

I am trying to convert an Excel file (test.xlsx from the attached zip) to PDF.
test.zip

The Excel contains only a cell, written with the Angelina font downloaded from https://www.1001freefonts.com/angelina.font.
When saving the workbook, I use PdfSaveOptions#setCompliance(PdfCompliance.PDF_A_1_B) and I am on a Linux computer (Ubuntu 20.04).

  1. if I don't install the font on my system, I have the result from the no_font.pdf file. Investigating the fonts from the PDF produces
$ pdffonts no_font.pdf
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
FAAABA+Tibetan_Machine_Uni           CID TrueType      Identity-H       yes yes yes     10  0
  1. now I install the font on my computer, I convert again the Excel and I get the with-angelina_font.pdf file. It has the same size, however the MD5 (for instance) is different (so the file is different) but pdffonts produces the same result!
  2. Now I am trying to see what's my default system font:
$ fc-match 
DejaVuSans.ttf: "DejaVu Sans" "Book"

So:

  • where is that FAAABA+Tibetan_Machine_Uni coming from?
  • why the Excel font (that may be seen for instance even with Libre Office!) is not embedded in the resulting PDF?
  • if the Excel font is not available on the system, what is the algorithm used by Aspose.Cells to pick a font ?
  • how could be programatically set the font to be used in case of missing on the system?

模板数据显示问题

样例:在excel单元格中写入&=entity.age,可以获取到所有entity.age的值,怎样才能只获取entity.name为张三的对象的age属性

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.