Aspose仅将几页pdf转换为html Not All

时间:2017-01-31 14:15:17

标签: java pdf aspose.pdf

我使用Aspose.Pdf for java将pdf转换为html。它只将PDF的前几页转换为HTML而不是所有页面。这只是在免费试用期间的限制还是我做错了什么。我从examples运行了com.aspose.pdf.examples.AsposePdfExamples.DocumentConversion.PDFToHTMLSingleHTMLWithAllResourcesEmbedded.java类。

该类的代码如下:

package com.aspose.pdf.examples.AsposePdfExamples.DocumentConversion;

import com.aspose.pdf.Document;
import com.aspose.pdf.HtmlSaveOptions;
import com.aspose.pdf.LettersPositioningMethods;

public class PDFToHTMLSingleHTMLWithAllResourcesEmbedded {

    public static void main(String[] args) {
        // Load source PDF file
        Document doc = new Document("input.pdf");
        // Instantiate HTML Save options object
        HtmlSaveOptions newOptions = new HtmlSaveOptions();
        // Enable option to embed all resources inside the HTML
        newOptions.PartsEmbeddingMode = HtmlSaveOptions.PartsEmbeddingModes.EmbedAllIntoHtml;
        // This is just optimization for IE and can be omitted
        newOptions.LettersPositioningMethod = LettersPositioningMethods.UseEmUnitsAndCompensationOfRoundingErrorsInCss;
        newOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsEmbeddedPartsOfPngPageBackground;
        newOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats;
        // Output file path
        String outHtmlFile = "Single_output.html";
        // Save the output file
        doc.save(outHtmlFile, newOptions);
    }

}

1 个答案:

答案 0 :(得分:0)

Aspose支持证实,它仅限免费试用期间的限制。 伤心:(