Inserting a cover and .Mobi conversion in Aspose Words

Hi There

Hope you’re well.

I called your Scottish office and was directed to ask my questions via the forum. We’re thinking about purchasing the license for the Aspose Words file converter to change documents into PDF and ePub. I have two questions:

  1. We were told that you’d also be including .Mobi support into the package in the future. Can you confirm a timescale for this and if it will be included at no additional charge?

  2. Is Aspose Words capable of taking a separate Cover Picture file and packaging it up with another (mainly text) file?

Look forward to hearing from you and progressing.

Many thanks

Adam

Hi Adam,

Thank you for your interest in Aspose.Words.

  1. Yes, we will consider supporting this format in the future. But unfortunately, we cannot provide you any reliable estimate at the moment.

  2. Could you please clarify what you need to achieve? Would you like to add a cover page to EPUB file or just generate a Word document where the first page will be an image and other pages will contain text?

Best regards,

Hi Alexey

Thanks for getting back to me.

  1. Okay. We’re really interested in .Mobi conversion as well, for your reference.

  2. Looking to convert a text doc (of some format) and combine with a picture file (likely JPEG) into on PDF or ePub file. Is this possible to pull two files and combine in the process?

Thanks

Adam

Hi Adam,

Thank you for additional information. Sure you can combine documents on the fly. For example see the following code that combines image (cover page) with MS Word document and saves the output as PDF:

[Test]
public void Test001()
{
    // Open image as Document.
    Document coverPage = ImageToDocument(@"Test001\coverPage.jpg");
    // Open word document.
    Document srcDoc = new Document(@"Test001\in.doc");
    // Combine documents.
    coverPage.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
    // Save output as PDF.
    coverPage.Save(@"Test001\out.pdf");
}

/// 
/// Loads an image to a Document.
/// 
public static Document ImageToDocument(string inputFileName)
{
    // Create Aspose.Words.Document and DocumentBuilder.
    // The builder makes it simple to add content to the document.
    Document doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);
    // Read the image from file, ensure it is disposed.
    using (Image image = Image.FromFile(inputFileName))
    {
        // Get the number of frames in the image.
        int framesCount = image.GetFrameCount(FrameDimension.Page);
        // Loop through all frames.
        for (int frameIdx = 0; frameIdx < framesCount; frameIdx++)
        {
            // Insert a section break before each new page, in case of a multi-frame TIFF.
            if (frameIdx != 0)
                builder.InsertBreak(BreakType.SectionBreakNewPage);
            // Select active frame.
            image.SelectActiveFrame(FrameDimension.Page, frameIdx);
            // We want the size of the page to be the same as the size of the image.
            // Convert pixels to points to size the page to the actual image size.
            PageSetup ps = builder.PageSetup;
            ps.PageWidth = ConvertUtil.PixelToPoint(image.Width, image.HorizontalResolution);
            ps.PageHeight = ConvertUtil.PixelToPoint(image.Height, image.VerticalResolution);
            // Insert the image into the document and position it at the top left corner of the page.
            builder.InsertImage(
                image,
                RelativeHorizontalPosition.Page,
                0,
                RelativeVerticalPosition.Page,
                0,
                ps.PageWidth,
                ps.PageHeight,
                WrapType.None);
        }
    }
    return doc;
}

Hope this helps.

Best regards,

Hi Alexey

Thanks for getting back to me quickly.

More concerned about ePUB book cover integration, over PDF. Is it possible with ePub? If not, is there an ETA of this being included?

Also what is a recomended image size for a A4 document, that would be useful to know as well?

Thanks

Adam

Hi

Thanks for your request. You can use the same code for EPUB too:

// Open image as Document.
Document coverPage = ImageToDocument(@"Test001\coverPage.jpg");
// Open word document.
Document srcDoc = new Document(@"Test001\in.doc");
// Combine documents.
coverPage.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
// Save output as EPUB.
coverPage.Save(@"Test001\out.epub");

Size of A4 page is 595.35 X 841.9 pt, so size of the image should be the same. If size of the image is different, you can always resize it.

Best regards,

Hi Alexey

Yep, we’ve done that - it works but doesn’t look as we’d prefer. When do you plan to make the book cover for ePUB as metadata of the document, so it will display on common eReaders?

Thanks

Adam

Hi Adam,

Thanks for your request. We plan to add this feature in 10.0.1 version of Aspose.Words. It is planned to be released in 2-3 months. We will notify you once this feature is available.

Best regards,

Great stuff, Alexey. We’ll probably be making a purchase prior to then, but it’s great to know a fix is in the pipeline.

Will be also really interested in updates around .Mobi conversion as well.

Appreciate your help, thanks

Adam

Hi Adam,

Thank you for your kind words. We will keep you informed regarding status of these issues and immediately let you know once they are resolved.

Best regards,

Hi you said cover and mobi support would be added to 10.0.1.

Your latest version is 10.3.0 but I do not see these options.

Have they not been added yet?

If not any idea when they will be added?

Brian

Hi Brian,

Thanks for your request. Please note, all estimates we provide in the forum are rough estimates and you cannot 100% rely on them.

An ability to create a cover pages is scheduled to be added in the next release. The responsible developer are currently working on this feature.

Regarding Mobi, currently the issue is not scheduled. So I cannot provide you any estimate regarding this issue.

Best regards,

I was wondering how Aspose is progressing with any of these features. Its been a while since it was suggested they might be coming soon?

Hope business is good.

Regards

Adam

Hi Adam,

Thanks for your request. The inserting cover page into ePub documents is scheduled to be implemented before the next release of Aspose.Words.

Unfortunately, there is no news about mobi.

Best regards,

Hello,

Just wondered if it is still likely for the book cover image to be added for the September release?

Regards

Adam

Hi

Thanks for your request. Yes, this feature is still scheduled to be implemented before the end of September. But since it is not implemented yet, I cannot 100% promise you that we will have time to include it into the next version.

Best regards,

Did this feature make the cut for the September release?

Regards

Adam

Hi Adam,

Thanks for your request. no unfortunately, this feature was not included into the recently released version of Aspose.Words.

Best regards,

Hi Alexey

I appreciate your short response, however this is unacceptable. We bought Aspose based on you informing us that this feature would be available later in 2011. It is now October and we have constantly been given very little information, or misinformed saying ‘the next release’. It is also not acceptable to simply write a single line of feedback on this subject when we have been waiting so long. This cannot go on.

I’d appreciate someone reaching out to me to discuss so we can move forward and put these disappointments behind us.

Regards

Adam

Hi Adam,

Thanks for your inquiry.

We understand your disappointment. I have asked the developer responsible for implementing this feature to provide a solid date where you can expect this feature to be included. He will provide you some feedback shortly.

We apologise for any inconvenience.

Thanks,