I am trying to insert base64_encoded pdf content in xml with below code.
1) Getting pdf data in variable.
$varFilePath = 'temp_invoices/' . $varFileName;
$arrFileData = file_get_contents($varFilePath);
$varPdfBase64 = base64_encode($arrFileData);
2) Using base64 data in xml tag
$Attachment->addChild('Attachment', $varPdfBase64);
The variable $varPdfBase64 has too big content and its creating problem.
Now when I am trying to download xml file this is showing plain text instead downloading with xml tags.
Note:- All tags are present in source code(ctrl+u).
How can I resolve this issue?