We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Merger pdf files return zero byte array output file

Hello,
I have problem when merge multiple files pdf, the output pdf result have zero byte array. for your information my code in c# net core and deployed on linux ubuntu server. the error message is " Object reference not set to an instance of an object." Here my code :
public static void MergerFilePDFAspose()
{
PdfFileEditor pdfEditor = new PdfFileEditor();
string[] filesArray = new string[3];
string sourcePdf1 = Path.Combine(Directory.GetCurrentDirectory(), “Template/1.pdf”);
string sourcePdf2 = Path.Combine(Directory.GetCurrentDirectory(), “Template/2.pdf”);
string sourcePdf3 = Path.Combine(Directory.GetCurrentDirectory(), “Template/3.pdf”);
string outputPath = Path.Combine(Directory.GetCurrentDirectory(), “Template/merged.pdf”);
filesArray[0] = sourcePdf1;
filesArray[1] = sourcePdf2;
filesArray[2] = sourcePdf3;
pdfEditor.Concatenate(filesArray, outputPath);
Console.WriteLine(“sukses”);
}

thanks before

@ahmad.faizin

Would you kindly make sure that all Microsoft Fonts are installed in the system. Please make sure to install msttcorefonts and libgdiplus packages and try again. In case you still notice any issues, please share your sample PDF documents along with complete stack trace information. We will further proceed to assist you accordingly.

@asad.ali ok thanks for your help. solved my my problem :slightly_smiling_face:

1 Like

@ahmad.faizin

It is good to know that your issue has been resolved. Please keep using our API and feel free to create a new topic in case you need more assistance.