First of all, awesome job on UltimatePDF !
I'm working on previewing a pdf with no margins. The layout ScreenToPDF is really helpful to show a pdf by a single web screen, especially without downloading it first. The only thing I miss is the ability to set the margin size (and possibly the paper size, but for now it's always A4).
Is it possibly to extend this functionality with those 2 parameters (or add a new one to save backwards compatibility)?
This would then be pretty similar to the server actions PrintToPDF and PrintToPDF_Advanced.
Cheers,
Geertjan
Hi Geertjan,
You can use the PrintLayout to set this, which is also part of ultimate pdf.
They actually have a PaperSize and MarginSize option.
The way this works is by adding it to the the screenToPdf..
Hope this solves your problem.
Kind regards,
Alexander
Thanks. I tried your solution, but it still ignores the no-margin setting. Do you have an example of this scenario working?
Hi GeertJan,
That is quite odd. I've added a screenshot of my setup and it seems to doesn't take the margin into account. Only that margin that is already set by the css classes.
I hope this helps you out.
ps: Apparantly I can only add one image if I don't want it inline I've also added the image of the generated pdf below:
Very odd. I guess it's caused by the content I'm using (image on full width/height of the page).
I fixed/worked around it by using the same pattern UltimatePDF is using in ScreenToPDF itself: setting the proper variables on action:
PrintToPDF_Advanced
and then using the standard Download action with parameter SaveToDisk=No.
Hmm interesting case. I guess the image may do some funky stuff.
Glad you found a workaround though!
Good to know.
Have a nice day.