Currently I am busy with converting HTML to PDF using the cfdocument function. A lot of stuff works very well and I am pleased with that. But I have some troubles with the margin setting which is important to make the layout more to our clients likings.
It seems that cfdocument isn’t listening to the marginleft, margintop etc. setting. I also tried downgrading the pdf.extension to lower versions, but still not working. It’s weird because in the thread posted below the user said after downgrading to “18.104.22.168” that everything was working again. If I do that then I get a corrupted PDF document so now I upgraded to “22.214.171.124” but then the margins don’t work (same as for 126.96.36.199)
So would be really great if this can be fixed in a newer version. I am hesitant to upgrade/downgrade lucee, because we had a lot of trouble with that in the past (extensions began to fail, websocket etc.)
Let me share also a more generic point. You said that when you downgraded the extension, you “get a corrupted PDF document”. As you may know, that can happen in various situations regarding browser rendering of such mime types (if that’s where you’re seeing the corruption), when you make some change about serving it on the server side.
A tip is to try the request (after a server-side change) in another browser entirely, or just a private/incognito window. Of course, you could also clear cache, or turn on your browser dev tools and tell it to disable cache for the request–or even more simply, just add a random query string to the url.
Let us know if that helps. I realize that if it does, the next question would be how to deal with users who may have the problem also. But let’s take it one step at a time.
thanks for the quick reply, I have added a simplified version of the code down below, but yes we use documentsection, so I can also use margin in the documentsection? I will try some things tomorrow and come back to you, thanks for the suggestion!
Hey, thanks for the suggestion but that’s not it I think. Also the PDF is corrupted in adobe acrobat and I have had more troubles like this. It’s because of mutliple PDF extensions and jar files that don’t work together or try to load the same functions. Btw when I upgraded the PDF extension to “188.8.131.52” I saw I had problems generating a PDF from a Docx (other jar file). So only the “184.108.40.206” version works well with the other plugins.
I find it hard to understand how I can arrange Lucee that everything loads well, that’s more my fault, but we do have a broad spectrum of functionalities in our project so that’s part of the problem. Also tried to use the javaloader but had difficulties using that. But if these troubles continue I could try to setup a clean small project and only test the jar files in different Lucee versions etc.