This topic is locked

I can't hide a section when exporting to PDF.

3/9/2026 15:54:55
PHPRunner General questions
A
ayctech author

Hi, I can't remove it from the PDF, I can only remove it at the HTML level, in php runner 10.91

$xt->assign("section_salario_liquidacion_view_block", false);
$pageObject->hideItem("section_salario_liquidacion_view");

javascript
$("div[data-itemid='section_salario_liquidacion_view']").remove();

img alt

img alt

2.png
1.png
ChatGPT 3/9/2026

It seems like you're trying to remove a section from the PDF output in PHPRunner, but you're only able to hide it in the HTML view. PHPRunner has different rendering methods for HTML and PDF outputs, and sometimes changes made in the HTML context do not automatically apply to the PDF.

To remove a section from the PDF output, you'll need to ensure that the specific section is not included in the PDF generation process. Here are a few steps you can follow to achieve this:

  1. Check PDF Settings: Go to the PDF settings in PHPRunner. Make sure that the section you want to hide is not selected for inclusion in the PDF. You can usually find this under the "PDF" tab in the properties or settings area.


  2. Modify the Code: If the section is being rendered through PHP, you can conditionally control its visibility in the PDF output. You might want to check if the current output is PDF before hiding the section. Use the following code snippet to conditionally hide the section in both HTML and PDF:

    if (!$pageObject->isPDF()) {
    $xt->assign("section_salario_liquidacion_view_block", false);
    $pageObject->hideItem("section_salario_liquidacion_view");
    }

  3. Use PDF Events: If you are using PDF events, ensure that you handle the visibility of items correctly in the BeforePDF event. For example, you can set a flag to skip rendering the section during PDF generation.


  4. Check the Template: In some cases, the PDF template itself may contain references to the section. Make sure to check the PDF template settings and remove any elements that reference the section you want to hide.


  5. Test the Changes: After making the changes, generate the PDF again to see if the section is removed as expected.



If you've followed these steps and are still having issues, you may want to consult the PHPRunner forums or documentation for more specific guidance related to your version (10.91) and the exact configuration you're using.

A
ayctech author 3/10/2026

I'm testing, and with only one section, it hides items in the PDF. With two sections, it no longer hides any items using $pageObject->hideItem("");.

This is a PHP runner error.