@@ -38,59 +38,3 @@ def resizeAllPages(self, documentName: str, htmlTempDoc: str, width: int, height
38
38
else :
39
39
logging .info ("resizeAllPages(): Successfully convert HTML tot PDF!" )
40
40
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