In PD4ML v4 setPageHeader(html, …) method injects a portion of the HTML code, enclosed to , right after opening tag. The strange behavior (the header printed twice) can only be theoretically explained if the header HTML is not well-formed or misbalanced and somehow as result merges both definitions. However it is difficult to imagine how the code should look like to achieve the effect. Could you please publish what is in Html2 and Html1 variables?