79554364

Date: 2025-04-04 02:53:18
Score: 3
Natty:
Report link
et footerAttributes: [NSAttributedString.Key: Any] = [
                                                          .font: UIFont.systemFont(ofSize: 20),
           //                                               .foregroundColor: UIColor.red.withAlphaComponent(
           //                                                   0.5),
                                                      ]
                                                      let footerString = NSAttributedString(
                                                          string: watermarkText, attributes: footerAttributes)

                                                      let footerTextWidth = footerString.size().width
                                                      let footerTextHeight = footerString.size().height

                                                      let footerX = (pageBounds.width - footerTextWidth) / 2
                                                      let footerY = 10 + footerTextHeight  // Adjust 10 as bottom margin

                                                      let footerAnnotation = PDFAnnotation(
                                                          bounds: CGRect(
                                                              x: footerX, y: footerY, width: footerTextWidth,
                                                              height: footerTextHeight),
                                                          forType: .freeText,
                                                          withProperties: nil
                                                          
                                                      )

                                                      footerAnnotation.contents = watermarkText.dropLast(2) + "**"
                                                      footerAnnotation.font = UIFont.systemFont(ofSize: 20)
                                                      footerAnnotation.color = .clear
                                                      footerAnnotation.fontColor = UIColor.darkGray
                                                          .withAlphaComponent(0.5)

                                                      page.addAnnotation(footerAnnotation)

i am not able to control the opacity of font why?

Reasons:
  • Blacklisted phrase (1): i am not able to
  • Blacklisted phrase (0.5): why?
  • Long answer (-1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Kanojiya Deepak