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

fix: dispose image file stream on SetImage #34

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: dispose image file stream on SetImage
  • Loading branch information
tcortega authored Jun 26, 2024
commit 830821aa2bc0027a2b85acd5b8e8c64a3600e512
2 changes: 1 addition & 1 deletion itext/itext.forms/itext/forms/fields/PdfButtonFormField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public virtual iText.Forms.Fields.PdfButtonFormField SetRadiosInUnison(bool radi
/// <see cref="PdfButtonFormField"/>
/// </returns>
public virtual iText.Forms.Fields.PdfButtonFormField SetImage(String image) {
Stream @is = FileUtil.GetInputStreamForFile(image);
using Stream @is = FileUtil.GetInputStreamForFile(image);
String str = Convert.ToBase64String(StreamUtil.InputStreamToArray(@is));
return (iText.Forms.Fields.PdfButtonFormField)SetValue(str);
}
Expand Down