|
23 | 23 | # response = instance.get_workbook( GetWorkbookRequest(EmployeeSalesSummaryXlsx , format='pdf' , folder=RemoteFolder) )
|
24 | 24 | # shutil.move( response ,"EmployeeSalesSummary2.pdf")
|
25 | 25 | # Now, Export a cloud Excel file to another format file directly, and directly save to local file.
|
26 |
| -instance.export_worksheet_as_format( ExportSpreadsheetAsFormatRequest( EmployeeSalesSummaryXlsx,"pdf" ,folder= "PythonSDK" ) , local_outpath="EmployeeSalesSummary2.pdf" ) |
| 26 | +instance.export_Spreadsheet_as_format( ExportSpreadsheetAsFormatRequest( EmployeeSalesSummaryXlsx,"csv" ,folder= "PythonSDK" ) , local_outpath="EmployeeSalesSummary.csv" ) |
| 27 | +instance.export_worksheet_as_format( ExportWorksheetAsFormatRequest( EmployeeSalesSummaryXlsx,"Sales", "pdf" ,folder= "PythonSDK" ) , local_outpath="EmployeeSalesSummary2.pdf" ) |
27 | 28 |
|
28 | 29 | #Save an Excel file of Cells Cloud as another format file of Cells Cloud.
|
29 | 30 | #instance.post_workbook_save_as( PostWorkbookSaveAsRequest( EmployeeSalesSummaryXlsx ,newfilename= "PythonSDK/EmployeeSalesSummary.pdf" ,folder=RemoteFolder ))
|
30 | 31 | instance.save_spreadsheet_as( SaveSpreadsheetAsRequest ( EmployeeSalesSummaryXlsx,"pdf" ,folder= RemoteFolder ) )
|
31 |
| -instance.download_file( DownloadFileRequest("PythonSDK/EmployeeSalesSummary.xlsx") , local_outpath="EmployeeSalesSummary3.pdf") |
| 32 | +instance.download_file( DownloadFileRequest("PythonSDK/EmployeeSalesSummary.pdf") , local_outpath="EmployeeSalesSummary3.pdf") |
32 | 33 |
|
33 | 34 |
|
34 | 35 | # Convert a local Excel file to pdf file directly. The return value is a file info object, which includes of file name, file content(base64string), and file size.
|
35 |
| -response = instance.post_convert_workbook_to_pdf( PostConvertWorkbookToPDFRequest( EmployeeSalesSummaryXlsx ,)) |
| 36 | +response = instance.post_convert_workbook_to_pdf( PostConvertWorkbookToPDFRequest( EmployeeSalesSummaryXlsx)) |
36 | 37 | filedata = base64.b64decode(response.file_content)
|
37 | 38 | with open("EmployeeSalesSummary.pdf", "wb") as file:
|
38 | 39 | file.write(filedata)
|
39 | 40 |
|
40 | 41 |
|
41 | 42 | # Convert a local Excel file to pdf file directly. The return value is a file info object, which includes of file name, file content(base64string), and file size.
|
42 |
| -response = instance.post_convert_workbook_to_json( PostConvertWorkbookToJsonRequest( EmployeeSalesSummaryXlsx ,)) |
| 43 | +response = instance.post_convert_workbook_to_json( PostConvertWorkbookToJsonRequest( EmployeeSalesSummaryXlsx)) |
43 | 44 | filedata = base64.b64decode(response.file_content)
|
44 | 45 | with open("EmployeeSalesSummary.json", "wb") as file:
|
45 | 46 | file.write(filedata)
|
46 | 47 |
|
47 | 48 |
|
48 | 49 | # Convert a local Excel file to docx file directly. The return value is a file info object, which includes of file name, file content(base64string), and file size.
|
49 |
| -response = instance.post_convert_workbook_to_docx( PostConvertWorkbookToDocxRequest( EmployeeSalesSummaryXlsx ,)) |
| 50 | +response = instance.post_convert_workbook_to_docx( PostConvertWorkbookToDocxRequest( EmployeeSalesSummaryXlsx)) |
50 | 51 | filedata = base64.b64decode(response.file_content)
|
51 | 52 | with open("EmployeeSalesSummary.docx", "wb") as file:
|
52 | 53 | file.write(filedata)
|
53 | 54 |
|
54 | 55 | # Convert a local Excel file to png file directly. The return value is a file info object, which includes of file name, file content(base64string), and file size.
|
55 |
| -response = instance.post_convert_workbook_to_png( PostConvertWorkbookToPNGRequest( EmployeeSalesSummaryXlsx ,)) |
| 56 | +response = instance.post_convert_workbook_to_png( PostConvertWorkbookToPNGRequest( EmployeeSalesSummaryXlsx)) |
56 | 57 | filedata = base64.b64decode(response.file_content)
|
57 | 58 | with open("EmployeeSalesSummary.png", "wb") as file:
|
58 | 59 | file.write(filedata)
|
59 | 60 |
|
60 | 61 | # Convert a local Excel file to pptx file directly. The return value is a file info object, which includes of file name, file content(base64string), and file size.
|
61 |
| -response = instance.post_convert_workbook_to_pptx(PostConvertWorkbookToPptxRequest(EmployeeSalesSummaryXlsx, )) |
| 62 | +response = instance.post_convert_workbook_to_pptx(PostConvertWorkbookToPptxRequest(EmployeeSalesSummaryXlsx)) |
62 | 63 | filedata = base64.b64decode(response.file_content)
|
63 | 64 | with open("EmployeeSalesSummary.pptx", "wb") as file:
|
64 | 65 | file.write(filedata)
|
65 | 66 |
|
66 | 67 | # Convert a local Excel file to html file directly. The return value is a file info object, which includes of file name, file content(base64string), and file size.
|
67 |
| -response = instance.post_convert_workbook_to_html(PostConvertWorkbookToHtmlRequest(EmployeeSalesSummaryXlsx, )) |
| 68 | +response = instance.post_convert_workbook_to_html(PostConvertWorkbookToHtmlRequest(EmployeeSalesSummaryXlsx)) |
68 | 69 | filedata = base64.b64decode(response.file_content)
|
69 | 70 | with open("EmployeeSalesSummary.html", "wb") as file:
|
70 | 71 | file.write(filedata)
|
|
73 | 74 | #response = instance.get_worksheet_with_format( GetWorksheetWithFormatRequest(EmployeeSalesSummaryXlsx, "Sales", folder ="PythonSDK", format="png", print_headings=True , one_page_per_sheet= False ) )
|
74 | 75 | #shutil.move( response ,"EmployeeSalesSummary_Sales.png")
|
75 | 76 | # Convert a worksheet of a local Excel file to another format file directly, and save as local file.
|
76 |
| -instance.convert_worksheet_to_image( ConvertWorkbookToImageRequest( EmployeeSalesSummaryXlsx,"Sales") , local_outpath="EmployeeSalesSummary_Sales.png") |
| 77 | +instance.convert_worksheet_to_image( ConvertWorksheetToImageRequest( EmployeeSalesSummaryXlsx,"Sales", format="png") , local_outpath="EmployeeSalesSummary_Sales.png") |
77 | 78 |
|
78 | 79 | # Convert a local Excel file's specified worksheet page index directly to another format file. Set query parameters : print_headings, one_page_per_sheet
|
79 | 80 | response = instance.get_worksheet_with_format( GetWorksheetWithFormatRequest(EmployeeSalesSummaryXlsx, "Sales", folder ="PythonSDK", format="png", page_index= 1 , print_headings=True , one_page_per_sheet= False ) )
|
80 | 81 | shutil.move( response ,"EmployeeSalesSummary_Sales_PageIndex.png")
|
81 | 82 |
|
| 83 | +# Convert a local Excel file's specified worksheet list object directly to another format file. Set query parameters |
| 84 | +instance.convert_table_to_pdf( ConvertTableToPdfRequest( EmployeeSalesSummaryXlsx , "Sales" , "Table1" ) , local_outpath="EmployeeSalesSummary_Sales_Table.pdf") |
| 85 | +instance.convert_table_to_image( ConvertTableToImageRequest( EmployeeSalesSummaryXlsx , "Sales" , "Table1" ,"png" ) , local_outpath="EmployeeSalesSummary_Sales_Table.png") |
| 86 | +instance.convert_table_to_image( ConvertTableToImageRequest( EmployeeSalesSummaryXlsx , "Sales" , "Table1" ,"svg" ) , local_outpath="EmployeeSalesSummary_Sales_Table.svg") |
| 87 | +instance.convert_table_to_json( ConvertTableToJsonRequest( EmployeeSalesSummaryXlsx , "Sales" , "Table1" ) , local_outpath="EmployeeSalesSummary_Sales_Table.json") |
| 88 | +instance.convert_table_to_html( ConvertTableToHtmlRequest( EmployeeSalesSummaryXlsx , "Sales" , "Table1" ) , local_outpath="EmployeeSalesSummary_Sales_Table.html") |
| 89 | + |
82 | 90 |
|
83 | 91 | # Convert a local Excel file's specified worksheet cells area directly to another format file. Set query parameters : print_headings, one_page_per_sheet
|
84 | 92 | # response = instance.get_worksheet_with_format( GetWorksheetWithFormatRequest(EmployeeSalesSummaryXlsx, "Sales", folder ="PythonSDK", format="png", area="B5:L36" ,print_headings=True , one_page_per_sheet= False ) )
|
|
0 commit comments