Skip to content

Commit 0c40b9f

Browse files
Update resize_document_all_pages.py
1 parent 831f25a commit 0c40b9f

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

Uses-Cases/ChangeLayout/resize_document_all_pages.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -38,59 +38,3 @@ def resizeAllPages(self, documentName: str, htmlTempDoc: str, width: int, height
3838
else:
3939
logging.info("resizeAllPages(): Successfully convert HTML tot PDF!")
4040
self.helper.downloadFile(outputDocumentName, outputDocumentName, localFolder, tempFolder, "resized_")
41-
42-
43-
44-
45-
46-
47-
48-
'''
49-
package main
50-
51-
import (
52-
"fmt"
53-
"path/filepath"
54-
55-
asposepdfcloud "github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v25"
56-
)
57-
58-
func resizeAllPages(pdf_api *asposepdfcloud.PdfApiService, document_name string, htmlTempDoc string, width int, height int, outputDocument string, localFolder string, tempFolder string) {
59-
uploadFile(pdf_api, document_name)
60-
61-
htmlTempPath := filepath.Join(tempFolder, htmlTempDoc)
62-
63-
args := map[string]interface{}{
64-
"folder": tempFolder,
65-
"documentType": string(asposepdfcloud.HtmlDocumentTypeXhtml),
66-
"outpputFormat": string(asposepdfcloud.OutputFormatFolder),
67-
}
68-
69-
_, response, err := pdf_api.PutPdfInStorageToHtml(document_name, htmlTempPath, args)
70-
71-
if err != nil {
72-
fmt.Println(err.Error())
73-
} else if response.StatusCode < 200 || response.StatusCode > 299 {
74-
fmt.Println("resizePages(): Can't convert pdf to html!")
75-
} else {
76-
fmt.Println("resizePages(): temporary file '" + htmlTempDoc + "' succesfully creaated.")
77-
}
78-
79-
args2 := map[string]interface{}{
80-
"folder": tempFolder,
81-
"htmlFileName": htmlTempDoc,
82-
"height": float64(height),
83-
"width": float64(width),
84-
}
85-
86-
_, response, err = pdf_api.PutHtmlInStorageToPdf(outputDocument, htmlTempPath, args2)
87-
if err != nil {
88-
fmt.Println(err.Error())
89-
} else if response.StatusCode < 200 || response.StatusCode > 299 {
90-
fmt.Println("resizePages(): Can't convert html to pdf!")
91-
} else {
92-
fmt.Println("resizePages(): Pages successfully resized.")
93-
downloadFile(pdf_api, outputDocument, "resized_doc_")
94-
}
95-
}
96-
'''

0 commit comments

Comments
 (0)