Remove borders on containers and controls (border adds extra pixels).
Force your printable container to the exact pixel dimensions for A5 in the same orientation that you pass to PDF().
1) Define constants (on OnStart or right before exporting)
// Portrait A5 at 96 DPI
Set(varA5Width, 560);
Set(varA5Height, 794);
If you need landscape, swap them: width = 794, height = 560 (and set Orientation: Landscape in PDF()).
2) Apply to your printable container
// Container1 exact page size
Container1.Width = varA5Width
Container1.Height = varA5Height
Container1.PaddingTop = 0
Container1.PaddingBottom = 0
Container1.PaddingLeft = 0
Container1.PaddingRight = 0
Container1.BorderThickness = 0 // if you had a border
Container1.Fill = RGBA(255,255,255,1) // soild background, not transparent
Avoid AutoHeight controls in the page; give labels/images fixed heights. AutoHeight + ExpandContainers can push the layout unpredictably and create a tiny overflow that becomes white space.
3) Try this first - Export with ExpandContainers:false
In many cases the white bar is caused by ExpandContainers:true letting an internal child auto-grow a hair more than the page height. Fixing the container to exact pixels and turning ExpandContainers off usually removes the gap.
If you must keep ExpandContainers:true
Keep every child fixed height (no AutoHeight).
Ensure no nested container has padding/border (those add pixels).
Ensure Image controls are set to ImagePosition = Fill and given explicit Height = exact px (don’t rely on Fill to compute height).
Keep everything aligned to integer X/Y/Height/Width (avoid decimal values from formulas like multipliers of ratios).
As a safety net, make the outermost container 1–2 px taller than A5 to absorb any rounding
ContainerOuter.Width = 560;
ContainerOuter.Height = 796; // 2 px buffer
ContainerInner.Width = 560;
ContainerInner.Height = 794;
Then pass ContainerOuter to PDF(). This hides any fractional push without visually changing your content.
Let us know if it helps!
✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
👍 Feel free to Like the post if you found it useful.