I was working on a new enhancement where i need to concatinate multiple pdf files into one file .
here the work flow may contain just one pdf file or multiple file , is there a dynamic way irrespective of the uploaded documents count where i can merge them in to one pdf file .
I would really appreciate your help , a code sample would be awesome .
I saw few samples online but they are not dynamic .
The Document class can be used to concatenate PDF files and once you have merged certain number of files, you can save the output in Stream instance and when you have some more documents to concatenate, you can instantiate Document object through same Stream instance and concatenate new files with already merged output. For more information, please visit Concatenate PDF Files
In case you still face any issue or you have any further query, please feel free to contact.
Thanks for your inquiry. You can create a list of your uploaded documents and concatenate them dynamically. Please check following sample code snippet, you can change it accordingly. Hopefully it will help you to accomplish.
Document targetDoc = newDocument();<o:p></o:p>
Document inputDoc;
List<String>
inputDocs = newList<String>();
inputDocs.Add("E:/data/s2.pdf");
inputDocs.Add("E:/data/HelloWorld.pdf");
for (int i = 0; i <
inputDocs.Count; i++)
{
inputDoc
= newDocument(inputDocs[i]);
// Add the pages of the source documents to the target
document
targetDoc.Pages.Add(inputDoc.Pages);
}
targetDoc.Save(myDir + "merged.pdf");
Please feel free to contact us for any further assistance.
HI Tilal,
I made good progress with your help, now i have few more hurdles ahead of me , hope you can help me overcome it .
I have a new work flow to convert below mentioned file formats to pdf format , can you please help me with converting these formats to pdf formats , a code sample would be awesome .
file formats for conversion
.msg
.jpeg
.txt
.bmp
which Aspose library should i refer to read all the above mentioned format before converting ?
Thanks for your inquriy. For excel files to PDF conversion you need to use Aspose.Cells for .NET. Please check following documentation link for details and code snippet, it will help you to accomplish the task.
Please explain a bit more about the issue by sharing the API version that you are using along with the sample code snippet so that we can further look into this matter and share our feedback with you.