Converti il formato JSON in EPUB tramite C++

Analizza da JSON a EPUB all’interno di applicazioni C++ senza utilizzare Microsoft® Word

 

Utilizzando Aspose.Total for C++ puoi analizzare JSON in EPUB all’interno delle tue applicazioni C++ in due semplici passaggi. Innanzitutto, utilizzando Aspose.Cells for C++ , puoi esportare JSON in PDF. Successivamente, utilizzando Aspose.Words for C++ , puoi convertire PDF in EPUB.

Converti il formato JSON in EPUB in C++

  1. Crea un nuovo oggetto IWorkbook e leggi dati JSON validi dal file
  2. Salva JSON come PDF utilizzando il metodo Save
  3. Caricare il documento PDF utilizzando la classe Document
  4. Salvare il documento in formato EPUB utilizzando il metodo Save

Requisiti di conversione

Installa tramite Package Manager Console di Visual Studio con Install-Package Aspose.Total.Cpp.

In alternativa, scarica il programma di installazione MSI offline o le DLL in un file ZIP da downloads .

// Load the JSON.
intrusive_ptr<Aspose::Cells::IWorkbook> wkb = Factory::CreateIWorkbook(u"sourceFile.json");
// Save in PDF format.
wkb->Save(u"convertedFile.pdf", SaveFormat_Pdf);
// Load the PDF.
System::SharedPtr<Document> doc = System::MakeObject<Document>(u"sourceFile.pdf");
// supports DOC, DOT, DOCM, DOTX, DOTX, FLATOPC, RTF, WordML, MOBI, CHM, ODT, OTT, PS, PCL, EPUB file formats
// Save in DOC format.
doc->Save(u"convertedFile.doc");

Imposta layout e converti formato JSON in EPUB in C++

Durante l’analisi da JSON a EPUB, puoi anche impostare la dimensione di righe e colonne caricando JSON con la classe IWorkbook . Se è necessario impostare la stessa altezza di riga per tutte le righe del foglio di lavoro, è possibile farlo utilizzando SetStandardHeight metodo della raccolta ICells . Allo stesso modo, per impostare la stessa larghezza di colonna per tutte le colonne del foglio di lavoro, utilizzare il metodo SetStandardWidth della raccolta ICells.

// Load the JSON.
intrusive_ptr<Aspose::Cells::IWorkbook> wkb = Factory::CreateIWorkbook(u"sourceFile.json");
// accessing the first worksheet in the Excel file
intrusive_ptr<IWorksheet> worksheet = workbook->GetIWorksheets()->GetObjectByIndex(0);
// setting the height of all rows in the worksheet to 25
worksheet->GetICells()->SetStandardHeight(25);
//Setting the width of all columns in the worksheet to 20.5
worksheet->GetICells()->SetStandardWidth(20.5);
// save in PDF format.
wkb->Save(u"convertedFile.pdf", SaveFormat_Pdf);
// Load the PDF.
System::SharedPtr<Document> doc = System::MakeObject<Document>(u"sourceFile.pdf");
// supports DOC, DOT, DOCM, DOTX, DOTX, FLATOPC, RTF, WordML, MOBI, CHM, ODT, OTT, PS, PCL, EPUB file formats
// Save in DOC format.
doc->Save(u"convertedFile.doc");

Converti il formato JSON in EPUB con Watermark in C++

Utilizzando l’API, puoi anche analizzare JSON in EPUB con filigrana. Per aggiungere una filigrana al tuo documento EPUB, puoi prima convertire JSON in PDF e aggiungervi una filigrana. Per aggiungere una filigrana, caricare il file PDF appena creato utilizzando la classe Document , impostare proprietà diverse per la filigrana di testo, chiama il metodo SetText e passa il testo e l’oggetto della filigrana di TextWatermarkOptions. Dopo aver aggiunto la filigrana, è possibile salvare il documento in EPUB.

// Load the JSON.
intrusive_ptr<Aspose::Cells::IWorkbook> wkb = Factory::CreateIWorkbook(u"sourceFile.json");
// Save in PDF format.
wkb->Save(u"convertedFile.pdf", SaveFormat_Pdf);
// Load the PDF.
System::SharedPtr<Document> doc = System::MakeObject<Document>(u"sourceFile.pdf");
// Set different properties for text watermark
auto options = System::MakeObject<TextWatermarkOptions>();
options->set_FontFamily(u"Arial");
options->set_FontSize(36);
options->set_Color(System::Drawing::Color::get_Black());
options->set_Layout(WatermarkLayout::Horizontal);
options->set_IsSemitrasparent(false);
// Set text for the watermark
docx->get_Watermark()->SetText(u"Test", options);
// supports DOC, DOT, DOCM, DOTX, DOTX, FLATOPC, RTF, WordML, MOBI, CHM, ODT, OTT, PS, PCL, EPUB file formats
// Save in DOC format.
doc->Save(u"convertedFile.doc");

Esplora JSON opzioni di conversione con C++

Convertire JSONs in CHM (File della Guida HTML compilato)
Convertire JSONs in DOC (Formato binario di Microsoft Word)
Convertire JSONs in DOCM (File Marco Microsoft Word 2007)
Convertire JSONs in DOT (File modello di Microsoft Word)
Convertire JSONs in DOTX (File modello di Microsoft Word)
Convertire JSONs in FLATOPC (Microsoft Word 2003 WordprocessingML)
Convertire JSONs in MOBI (Apri formato ebook)
Convertire JSONs in ODP (Formato di presentazione OpenDocument)
Convertire JSONs in ODT (Formato file di testo OpenDocument)
Convertire JSONs in OTP (Formato standard OpenDocument)
Convertire JSONs in OTT (Modello OpenDocument)
Convertire JSONs in PCL (Linguaggio dei comandi della stampante)
Convertire JSONs in POT (File modello di Microsoft PowerPoint)
Convertire JSONs in POTM (File modello di Microsoft PowerPoint)
Convertire JSONs in POTX (Presentazione modello Microsoft PowerPoint)
Convertire JSONs in POWERPOINT (File di presentazione)
Convertire JSONs in PPS (Presentazione PowerPoint)
Convertire JSONs in PPSM (Presentazione con attivazione macro)
Convertire JSONs in PPSX (Presentazione PowerPoint)
Convertire JSONs in PPT (Presentazione Powerpoint)
Convertire JSONs in PPTM (File di presentazione con attivazione macro)
Convertire JSONs in PS (File Postscript)
Convertire JSONs in WORD (Formati di file di elaborazione testi)
Convertire JSONs in WORDML (Microsoft Word 2003 WordprocessingML)