Forum Replies Created
-
AuthorPosts
-
in reply to: Technical questions / Troubleshooting June 6, 2025 at 17:29#39644
Hi.
I try to generate a pdf document.
We need to setup a background image – this is the company letter paper. I did this and this works fine.Now we have the problem each paper has an footer. In the footer their are informations like page, date or something else. If i generate the pdf with background all looks perfect as pdf. But if i render without background and print that, the positions of the informations are not exactly and the data is not at the correct position.
Now I am looking where i could do the mistake.
Here a little bit code, but it is in scala.
def setPaper(formatName: String, overrideWidthInMM: Int = 0, overrideHeightInMM: Int = 0): Unit = { formatName.toUpperCase match { case "A3" => pd4ml.setPageSize(PageSize.A3) pd4ml.setHtmlWidth(PD4Constants.A3.width) case "A4" => pd4ml.setPageSize(PageSize.A4) pd4ml.setHtmlWidth(ptToPx(PD4Constants.A4.width).toInt) case "A5" => pd4ml.setPageSize(PageSize.A5) pd4ml.setHtmlWidth(ptToPx(PD4Constants.A5.width).toInt) case "A6" => pd4ml.setPageSize(PageSize.A6) pd4ml.setHtmlWidth(ptToPx(PD4Constants.A6.width).toInt) case _ => pd4ml.setPageSize(new PageSize(overrideWidthInMM.toFloat,overrideHeightInMM.toFloat,Units.MM)) pd4ml.setHtmlWidth(ptToPx(mmToPt(overrideWidthInMM)).toInt) } }
the mmToPt an ptToPx is here
def mmToPt(mm: Double): Double = { PD4ML.translateToPt(mm.toFloat) } def ptToPx(pt: Double): Double = { pt*1.333 }
The old version takes at mmToPt: mm*2.8346456693
I think the setHtmlWidth needs all in px. I hope that is correct.
Also i am using this pd4ml.protectPhysicalUnitDimensions(true)
Is their something wrong?
in reply to: Licensing / Purchasing of PD4ML June 10, 2025 at 15:41#39648I just wanted to verify, before I purchase my licenses. With a PD4ML license (PD4ML Pro), I can select the version of PD4ML that I integrate into my application, right? I am looking for PD4ML in version 3 but using the jakarta.servlet package namespace.
in reply to: Licensing / Purchasing of PD4ML July 7, 2025 at 08:02#39762Hello,
I want to buy your product as a single license but I am not sure about one thing.
Does single license apply to all pods of my service or I have to buy license per pod?
it is not clear to me as I red in docs: “OR on a single Web-server (means a single hardware computer identified by a single IP/DNS address)”
in reply to: PD4ML Version3 for Jakarta August 1, 2025 at 14:49#39846I just wanted to verify, before I purchase my licenses. With a PD4ML license (PD4ML Pro), I can select the version of PD4ML that I integrate into my application, right? I am looking for PD4ML in version 3 but using the jakarta.servlet package namespace.
I’m in the same case than you. However i have already a licence and i cannot see a jakarta version of PML version 3.
in reply to: Technical questions / Troubleshooting August 2, 2025 at 19:55#39848Hi Support,
I’m encountering an issue when attempting to add a PNG image to a PDF using PD4ML. The same code works without any issues when using JPG images. However, when using PNGs, I receive a java.security.AccessControlException, specifically related to the use of System.setErr. It seems that during PNG image processing, PD4ML attempts to redirect System.err, which is blocked by our Java security manager.
Below is the relevant exception trace:
java.security.AccessControlException: Access denied ("java.lang.RuntimePermission" "setIO") at java.base/java.security.AccessController.throwACE(Unknown Source) at java.base/java.security.AccessController.checkPermission(Unknown Source) ... at java.base/java.lang.System.setErr(Unknown Source) at com.pd4ml.css.util.d.o00000(y:3477) at com.pd4ml.cache.img.d.super(y:2531) ... at com.pd4ml.PD4ML.writePDF(y:3447)
This is likely due to internal PNG image handling in PD4ML triggering a call to System.setErr, which our environment restricts for security reasons.
Can you confirm whether this is expected behavior when handling PNGs? If so, is there a workaround or configuration option to prevent PD4ML from attempting to reset System.err, or a way to process PNGs without triggering this permission?
I have also attached the image (it was generated by ChatGTP as far as I recall).
Thank you,
DmytroAttachments:
You must be logged in to view attached files. -
AuthorPosts