Using a PDF as a background image

Using version 1.4.1 - in designer I have set the PDF from the Data Mapper as the background image. this PDF contains both Portrait and Landscape pages both A4. is it possible to auto rotate the PDF so that the Landscape are rotated 90 degrees to make them portrait? or how is best to handle this type of PDF?

Probably the best solution would be something like this:

var someImg = $("#someId");
if (someImg.width() > someImg.height()){
    //it's a landscape so rotate the PDF
} else if (someImg.width() < someImg.height()){
    //it's a portrait
} else {
    //image width and height are equal, therefore it is square.
}

Hi - thank you for this I will give it a go

No problem, the only downside to this is that it is working in the DOM and as such could cause unexpected results sometimes… Avoid DOM where possible

hi guys, I have read through this post. the sample script you have in the first response, where do you put this as when I look at the source code of m y print section there is no HTML in there but the pdf from data mapper image is being used as the back ground?

also I noted the point iBaldie made about the DOM again not something I have any idea about but for my situation. the first page of each document is portrait all subsequence document pages are landscape. therefore would a simple way to get round the DOM resource hungry issue be to have 2 print sections and control which one is one and off? if so how can a do this?

Please check the following post: