How to exclude a field when export to pdf?

Hello everyoneWhen exporting to PDF and there is a .pdf file in some field, the exported file appears with a box with an x ​​in the center “Image not found or unknown type”
How could I hide that field when exporting but I need to see it in the viewpage or how to export the file location url

// PageRender event
function Page_Render()
{
    //Log("Page Render");
if (IsExport("pdf")) {
$this->CERTIFICATION->Visible = FALSE; // adjust FieldName to your current field name
}
}

this code does not work

https://discourse.hkvstore.com/t/export-to-word-from-view-page/8702/1