We have an ASP.Net application to merge a Word document with data and the result is converted to a PDF document. I would like to know if there is an option to control the PDF layout so that I can print 2 pages on one sheet. The original Word document is set up with orientation as Portrait. I would like to resize the pages to print 2 pages in Landscape.
Hi Kalyan,
Please clarify whether you want to put two Word document pages on a single PDF page while converting Word document to PDF, or you’re interested in printing the two PDF pages on a single page using a printer? Moreover, please confirm that you’re using Aspose.Words and Aspose.Pdf.Kit for that matter?
We’re looking forward to help you out.
Regards,
Actually we have the ASPOSE Total family. As for your question, we are interested in printing the 2 PDF pages on a single page.
Hi Kalyan,
We need to look into your scenario in detail at our end. Please spare us some time and you’ll be updated with the results the earliest possible.
We’re sorry for the inconvenience.
Regards,
Hi Kalyan,
I have looked into your requirement in detail and I would like to share with you that your requirement can be fulfilled using Make N-Up option. Please have a look at this topic. For example, if your file has two pages and you want to print those two pages on a single page, you can first use the following code snippet to create a new file having two pages on a single page:
PdfFileEditor fileEditor = new PdfFileEditor();
fileEditor.MakeNUp(“input.pdf”, “output.pdf”, 2, 1);
After that you can print this output file using the sample on this link.
I hope this helps. If you have any further questions, please do let us know.
Regards,
Here are our findings:
We found that the MakeNUp method works for pdf files, but not for memory stream.
The following line works fine, and I got TestAspose.pdf with correct page content.
pdfEditor.MakeNUp("c:\\DisplayPDFFile.pdf", "c:\\TestAspose.pdf", 2, 1);
But the following line did not work, memStreamPosition1 is always 0
pdfEditor.MakeNUp(memStreamPosition, memStreamPosition1, 2, 1);
The only way we got it to work is to save memStreamPosition to a pdf file on disk, convert it to another pdf file, and read back to memStreamPosition1.
This is not a prefereed solution. I am not suire if you have a better solution than this. Can you explain why the following command does not work.
pdfEditor.MakeNUp(memStreamPosition, memStreamPosition1, 2, 1);
Thanks
Hi Kalyan,
I have tested this issue with the latest version at my end, but couldn’t notice any such problem. I have used the following code snippet with version 5.1.0:
PdfFileEditor fileEditor = new PdfFileEditor();
MemoryStream inStream = new MemoryStream(File.ReadAllBytes(“input.pdf”));
MemoryStream outStream = new MemoryStream();
fileEditor.MakeNUp(inStream, outStream, 2, 1);
FileStream outFile = new FileStream(“output.pdf”, FileMode.Create);
outStream.WriteTo(outFile);
outFile.Close();
Please make sure that you’re using the latest version. If you still find any issues, please share the input PDF file along with the code snippet you’re using at your end, so we could test the issue over here. You’ll be updated with the results accordingly.
We’re sorry for the inconvenience.
Regards,