Hi,
We have a requirement as follows…
3 documents from 3 different data sources coming in as byte arrays. We need to merge these 3 byte arrays and convert the resulting into a PDF…
One of these byte arrays is a word document in Word ML format.
I have been researching for a way to merge the byte arrays, but it looks like only aspose.NET
has a solution, not aspose Java.
Is there any way we can manipulate the byte array streams in Java ?
Hello Afzal,
Thanks for using our products.
I am a representative from Aspose.Pdf team. This product provides the capability to create PDF documents from scratch using it’s API. You can also convert Image file, Text file, HTML file, XML and XSL files into PDF format. However, before I have commented further over your requirement, can you please share some more details about the format of files in Input Byte array.
Hi,
Two of the byte arrays are complete formated WordML documents (Word 2003 WordML) derived from two different web sources possibly with each having a unique header and footer. The third is a standard Word document. There is very little or no image data in these document. We have a need generate all three of them independently for customer reasons.
Also there is final report that has to stitch all three into a single PDF, retaining the header information while making sure the page numbers are properly formatted.
The way we figured out was a roundabout way where we generate 3 separate PDF documents for each of the independent streams and then stitch the PDFs together to get the final one using the PDF combining functionality in Aspose. But since these are all file operations, its going to take a lot of time (which is incidentally the reason we are looking for an integrated solution).
-Afz
Hello Afzal,
Thanks for sharing the information.
As far as I can see the all the three source documents are MS Word based (different format) so I believe Aspose.Words can make your work easy. Using this product, I hope you can read, merge all source documents and finally save the concatenated word file into PDF format. For your convenience, I am moving this thread to Aspose.Words forum where I believe our team of experts taking care of this product will be in better position to further assist you in this regard. Meanwhile you may visit the following links for better understanding on
Hi
Thanks for your request. You can easily open a document from byte array using Aspose.Words and convert it to PDF. Then you can use Aspose.Pdf.Kit to concatenate this PDF with other PDFs.
Here is simple code that shows how to open document from byte array.
// Get document's byte array
byte fileContent[] = GetDocumentBytes();
// Create a byte array inout stream.
ByteArrayInputStream docStream = new ByteArrayInputStream(fileContent);
// Create document from stream.
Document doc = new Document(docStream);
// Do something with document.
// ...............
// Save output.
doc.save("C:\\Temp\\out.doc");
Hope this helps.
Best regards,