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:
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?
Is Aspose Words capable of taking a separate Cover Picture file and packaging it up with another (mainly text) file?
Yes, we will consider supporting this format in the future. But unfortunately, we cannot provide you any reliable estimate at the moment.
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?
Okay. We’re really interested in .Mobi conversion as well, for your reference.
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?
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;
}
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.
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 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.
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.
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.
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.