-
-
Save aspose-com-gists/aa32e346fae9721e49032e37600a339e to your computer and use it in GitHub Desktop.
# Load Excel file | |
workbook = Workbook("Book1.xlsx") | |
# Create and set PDF options | |
pdfOptions = PdfSaveOptions() | |
pdfOptions.setCompliance(PdfCompliance.PDF_A_1_B) | |
# Convert Excel to PDF | |
workbook.save("xlsx-to-pdf.pdf", pdfOptions) |
# Load Excel file | |
workbook = Workbook("Book1.xlsx") | |
# Convert Excel to PDF | |
workbook.save("xlsx-to-pdf.pdf", SaveFormat.PDF) |
----> 1 workbook.save("xlsx-to-pdf.pdf", SaveFormat.PDF)
AttributeError: 'Workbook' object has no attribute 'save'
You can convert as many Excel files to PDF format as you like. To add header letter of the company, you may take company's header letter picture and add this image as header picture (via relevant PageSetup method) using Aspose.Cells APIs before rendering to PDF.
The method is there, see the API reference page. Make sure you have installed latest Aspose.Cells for Python via Java version, e.g. using the following pip command.
pip install aspose-cells
and then import/set relevant classes and other objects initialized at the start of your sample code accordingly:
e.g.
import jpype
import asposecells
jpype.startJVM()
from asposecells.api import Workbook, SaveFormat, PdfSaveOptions
........
We also recommend you to post your queries or issue in dedicated forums here.
It leaves aspose mark on pdf? Can anyone help How to remove "Evaluation Only. Created with Aspose Cells for Python via Java.Copyright 2003 - 2023 Aspose pty Ltd." Please help anyone its urgent.
If you are using Aspose.Cells for Python via Java API in evaluation (default) mode, an evaluation watermark will appear in the output file. To remove the watermark, you need to have a valid license and set it in code (at the start) before using any other API of Aspose.Cells for Python via Java. For more information on licensing, please refer to the document on licensing. If you want to test the API without any limits, you may request a 30-day temporary license. Please refer to How to get a Temporary License? for more information. If you have any queries or comments, please post them in the dedicated forum.
what if i have around 40 excel files , and need to convert them to PDF , and add also head letter of company ?