Gunakake perpustakaan Go kanggo nggabungake Word menyang PDF liwat REST API. Gabungke loro utawa luwih Word berkas dadi siji berkas PDF nganggo Go.
Gabung Word format menyang PDF kanthi gampang ing Go kode. Pustaka Go iki dirancang kanggo nggabungake pirang-pirang Word file dadi PDF file siji nggunakake REST API, yaiku kanthi ngirim telpon HTTPS liwat Internet.
Iki minangka solusi gabungan Word to PDF profesional Cloud-native sing nyedhiyakake programer Go kanthi keluwesan pangembangan lan fitur sing kuat. Gabung karo Word file asring digunakake nalika perlu kanggo nggawe set PDF dokumen saka struktur sing padha, sing saben ngemot data unik. Kanthi nggabungake file, sampeyan bisa ngotomatisasi alur kerja Word/PDF digital lan mbukak sawetara bagean rutin proses kasebut menyang piranti lunak Go ngolah dokumen kanthi cepet lan efisien.
Sampeyan bisa uga kudu nggabungake Word file dadi siji PDF file ing akeh kasus. Contone, sampeyan bisa uga pengin nggabungake macem-macem Word file bebarengan sadurunge nyetak utawa arsip.
Penggabungan Word bisa dadi bagean saka pendekatan pangolahan dokumen terpadu kanggo ngasilake PDF dokumen saka sumber data sing beda-beda. tugas kuwi ndherek nggunakake Word lengkap / PDF manipulasi Go perpustakaan sing bakal proses pesawat saka Word file lan gabungke bebarengan ing wektu paling cendhak, mrodhuksi asil PDF kompak lan akurat.
Kanggo nindakake gabungan Word kanggo PDF ing Go, sampeyan butuh paling ora rong Word file sumber. Kanggo miwiti kanthi cepet, priksa conto Go kode ing ngisor iki.
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models"
)
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
document, _ := os.Open("Input1.docx")
// Muat dokumen kanggo nambah saka panyimpenan Cloud.
mergeDocument := models.DocumentEntry{
FileReference: models.CreateRemoteFileReference("Input2.docx"),
ImportFormatMode: ToStringPointer("KeepSourceFormatting"),
}
documentEntries := []models.DocumentEntry{ mergeDocument, }
documentList := models.DocumentEntryList{ DocumentEntries: documentEntries, }
appendDocumentOnlineOptions := map[string]interface{}{}
appendDocumentOnline := &models.AppendDocumentOnlineRequest{
Document: document,
DocumentList: documentList,
Optionals: appendDocumentOnlineOptions,
}
_, _, _ = wordsApi.AppendDocumentOnline(ctx, appendDocumentOnline)
Run go get -v github.com/aspose-words-cloud/aspose-words-cloud-go/2007/api kanggo nginstal Aspose.Words Cloud SDK for Go. Sampeyan bisa entuk akeh informasi migunani babagan cara instalasi liyane saka bagean "How to use SDK".
Klone Aspose.Words Cloud SDK for Go saka GitHub lan gunakake ing proyek sampeyan. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.
Deleng Repository Documentation kanggo ndeleng rincian.
Sampeyan bisa nggunakake format populer liyane: