Skip to content

Commit 48d367e

Browse files
Aspose.PDF for Go via C++ 25.8
1 parent 2756270 commit 48d367e

10 files changed

+46
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Contains unique features for converting PDF to other formats.
1919

2020
### PDF converting and saving
2121

22-
- **Microsoft Office:** DOC, DOCX, XLSX, PPTX
22+
- **Microsoft Office:** DOC, DOCX, XLSX, PPTX, DOCX with Enhanced Recognition Mode (fully editable tables and paragraphs)
2323
- **Images:** JPEG, PNG, BMP, TIFF
2424
- **Others:** EPUB, DICOM, SVG, XPS, TEX, TXT, MD, N-UP PDF, BOOKLET PDF
2525
- **Export with AcroForm:** FDF, XFDF, XML

asposepdf_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ func TestConvertFromPDF(t *testing.T) {
379379

380380
conversions := []conversion{
381381
{"SaveDocX", func(doc *Document, path string) error { return doc.SaveDocX(path) }},
382+
{"SaveDocXEnhanced", func(doc *Document, path string) error { return doc.SaveDocXEnhanced(path) }},
382383
{"SaveDoc", func(doc *Document, path string) error { return doc.SaveDoc(path) }},
383384
{"SaveXlsX", func(doc *Document, path string) error { return doc.SaveXlsX(path) }},
384385
{"SaveTxt", func(doc *Document, path string) error { return doc.SaveTxt(path) }},

document.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,25 @@ func (document *Document) SaveDocX(filename string) error {
644644
}
645645
}
646646

647+
// SaveDocXEnhanced saves previously opened PDF-document as Enhanced Recognition Mode DocX-document with filename.
648+
//
649+
// Example:
650+
//
651+
// err := pdf.SaveDocXEnhanced("filename.docx")
652+
func (document *Document) SaveDocXEnhanced(filename string) error {
653+
var err *C.char
654+
_filename := C.CString(filename)
655+
defer C.free(unsafe.Pointer(_filename))
656+
C.PDFDocument_Save_DocXEnhanced(document.pdf, _filename, &err)
657+
err_str := C.GoString(err)
658+
C.c_free_string(err)
659+
if err_str != ERR_OK {
660+
return errors.New(err_str)
661+
} else {
662+
return nil
663+
}
664+
}
665+
647666
// SaveDoc saves previously opened PDF-document as Doc-document with filename.
648667
//
649668
// Example:

extern_c.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ extern "C" {
5454
ASPOSE_PDF_RUST_SHARED_API void PDFDocument_Save_Booklet(void* pdfdocumentclass, const char* filename, const char** error);
5555
ASPOSE_PDF_RUST_SHARED_API void PDFDocument_Save_NUp(void* pdfdocumentclass, const char* filename, int columns, int rows, const char** error);
5656
ASPOSE_PDF_RUST_SHARED_API void PDFDocument_Save_Tiff(void* pdfdocumentclass, int resolutionDPI, const char* filename, const char** error);
57+
ASPOSE_PDF_RUST_SHARED_API void PDFDocument_Save_DocXEnhanced(void* pdfdocumentclass, const char* filename, const char** error);
5758
ASPOSE_PDF_RUST_SHARED_API void PDFDocument_Export_Fdf(void* pdfdocumentclass, const char* filename, const char** error);
5859
ASPOSE_PDF_RUST_SHARED_API void PDFDocument_Export_Xfdf(void* pdfdocumentclass, const char* filename, const char** error);
5960
ASPOSE_PDF_RUST_SHARED_API void PDFDocument_Export_Xml(void* pdfdocumentclass, const char* filename, const char** error);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f1fba852059f9c2c531cd267e75ccff82d4f0437204a76924178472ee1987530
1+
8cea1f259c6337290a230541bf7e3e09b291bcc0260abc64f77e32f82a0f1e6c
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ab74bbe468a039a32c39042b68941eb1353badadc3c0d6241b02e6bc22013f56
1+
606a7be4cbeb77f1fa65f3737d32b40cf78dcaa9b107468e3601bf8eacd9e7cd
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c505445132e97ff6d89f2587faca664df63d9b48f5643096fbbbfe2929c20b7d
1+
24ae016ba017499296f2dcc755a3909aa5bfda7fa3694682bfde5aacb60bd494
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6cadb8ad6797c687b359f9a4dfc5b352d65c0c0c7f0a79a250aae078cde300d9
1+
23e30d13c5616ca14a35be5847dc8bf3fd1feaa3eec062c64f33ed3ba1b6df20

snippets/SaveDocXEnhanced.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package main
2+
3+
import "github.com/aspose-pdf/aspose-pdf-go-cpp"
4+
import "log"
5+
6+
func main() {
7+
// Open(filename string) opens a PDF-document with filename
8+
pdf, err := asposepdf.Open("sample.pdf")
9+
if err != nil {
10+
log.Fatal(err)
11+
}
12+
// SaveDocX(filename string) saves previously opened PDF-document as Enhanced Recognition Mode DocX-document with filename
13+
err = pdf.SaveDocXEnhanced("sampleEnhanced.docx")
14+
if err != nil {
15+
log.Fatal(err)
16+
}
17+
// Close() releases allocated resources for PDF-document
18+
defer pdf.Close()
19+
}

unzip.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"strings"
2121
)
2222

23-
const verLibsTag = "v1.25.7"
23+
const verLibsTag = "v1.25.8"
2424
const repoLibsURL = "https://raw.githubusercontent.com/aspose-pdf/aspose-pdf-go-cpp-libs/"
2525
const repoLibsDir = "libs/"
2626

0 commit comments

Comments
 (0)