Undo previous fix, it generated an extra page in pdf files.
Better fix under investigation.