Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] : Not able to provide different colour to different form field in the PDF. #563

Open
sukhendu321 opened this issue Aug 6, 2024 · 2 comments
Labels
feature New feature

Comments

@sukhendu321
Copy link

Unidoc version: v3.61.0

fieldAppearance := annotator.FieldAppearance{OnlyIfMissing: true, RegenerateTextFields: true}

// specify a full set of appearance styles
fieldAppearance.SetStyle(annotator.AppearanceStyle{
	AutoFontSizeFraction: 0.70,
	FillColor:            model.NewPdfColorDeviceRGB(1, 1, 1),
	BorderColor:          model.NewPdfColorDeviceRGB(0, 0, 0),
	BorderSize:           2.0,
	AllowMK:              false,
	TextColor:            model.NewPdfColorDeviceRGB(0.5, 0.8, 0.8), // text color as normalized RGB values
})

// Populate the form data with appearance.
pdfReader.AcroForm.FillWithAppearance(fieldData, fieldAppearance)

@kellemNegasi i am trying to change different fieldData with different colour but it is changing all the fieldData colours.
Expected behaviour is to change specific fields with specific colour

@kellemNegasi
Copy link

Hi @sukhendu321 currently there is no API for setting text color to text fields individually during filling or flattening. Setting separete text color for each text field is only possible when creating the form. Can you check this example
https://github.com/unidoc/unipdf-examples/blob/master/forms/pdf_form_with_text_color.go ?

@sukhendu321
Copy link
Author

hey @kellemNegasi thanks for the reply
Could you please let us know if there are any plans to incorporate this feature in future updates?

Looking forward to your feedback.

@ipod4g ipod4g added the feature New feature label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

No branches or pull requests

3 participants