Vi accepterer i øjeblikket ikke EPUB filer som input. Men vi kan producere EPUB filer som output. Vi ser frem til fuld EPUB support i den nærmeste fremtid.
Ved at bruge vores kraftfulde Go API kan udviklere komprimere EPUB dokumenter for at optimere indhold og outputfilstørrelse. Reduktion af EPUB størrelse sker ved at rydde op i ubrugte data og ressourcer. Du kan også komprimere billeder inde i EPUB for at gøre outputfilstørrelsen endnu mindre.
Resultatet af indholdsoptimering og -komprimering kan gemmes i den originale EPUB eller et hvilket som helst tilgængeligt gemt format - DOCX, DOC, RTF, HTML og mange andre. For eksempel, komprimere EPUB og gemme output som Word.
Som nævnt giver vores Go SDK dig mulighed for programmæssigt at reducere EPUB størrelsen. Og nu kan du prøve vores kraftfulde funktionalitet og evaluere, hvordan du komprimerer EPUB i Go med følgende eksempel:
import (
"os"
"github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models"
)
config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
requestDocument, _ := os.Open("Input.docx")
requestCompressOptions := models.CompressOptions{
ImagesQuality: ToInt32Pointer(int32(75)),
ImagesReduceSizeFactor: ToInt32Pointer(int32(1)),
}
compressDocumentOnlineOptions := map[string]interface{}{}
compressDocumentRequest := &models.CompressDocumentOnlineRequest{
Document: requestDocument,
CompressOptions: &requestCompressOptions,
Optionals: compressDocumentOnlineOptions,
}
compressDocument = wordsApi.CompressDocumentOnline(ctx, compressDocumentRequest)
convertDocumentOptions := map[string]interface{}{}
convertDocument := &models.ConvertDocumentRequest{
Document: compressDocument.Document.Values[0],
Format: ToStringPointer("epub"),
Optionals: convertDocumentOptions,
}
_, _ = wordsApi.ConvertDocument(ctx, convertDocument)
Kør go get -v github.com/aspose-words-cloud/aspose-words-cloud-go/2007/api for at installere Aspose.Words Cloud SDK for Go. Du kan få en masse nyttig information om andre installationsmetoder fra afsnittet "How to use SDK".
Klon Aspose.Words Cloud SDK for Go kildekode fra GitHub og brug den i dit projekt. Følg venligst disse Instructions for hurtigt at få de nødvendige sikkerhedsoplysninger og få adgang til vores REST API.
Se Repository Documentation for at se detaljerne.
Du kan udføre dokumentkomprimering for andre filformater: