The DLLs-only package of GroupDocs.Signature for .NET 24.7 offers convenient integration with your existing .NET projects. This release delivers optimized preview options and broad Code93 barcode functionality across Windows, Linux, and MacOS platforms.
Add Modernized Preview Options to Your .NET Apps
The obsolete constructors in the PreviewOptions
class are removed in the latest .NET barcode processing API release. Developers can leverage the updated constructors to seamlessly generate signature previews, as illustrated in the C# code sample below.
public static void GeneratePreview()
{
// The path to the documents directory.
string filePath = Constants.SAMPLE_PDF;
using (Signature signature = new Signature(filePath))
{
// create preview options object
PreviewOptions previewOption = new PreviewOptions(GeneratePreview.CreatePageStream, GeneratePreview.ReleasePageStream)
{
PreviewFormat = PreviewOptions.PreviewFormats.JPEG,
};
// generate preview
signature.GeneratePreview(previewOption);
}
}
private static Stream CreatePageStream(PreviewPageData pageData)
{
string imageFilePath = Path.Combine(Constants.OutputPath, "GeneratePreviewFolder", "image-" + pageData.PageNumber.ToString() + ".jpg");
var folder = Path.GetDirectoryName(imageFilePath);
if (!Directory.Exists(folder))
{
Directory.CreateDirectory(folder);
}
return new FileStream(imageFilePath, FileMode.Create);
}
private static void ReleasePageStream(PreviewPageData pageData, Stream pageStream)
{
pageStream.Dispose();
string imageFilePath = Path.Combine(Constants.OutputPath, "GeneratePreviewFolder", "image-" + pageData.PageNumber.ToString() + ".jpg");
Console.WriteLine($"Image file {imageFilePath} is ready for preview");
}
Source*
Streamlined Barcodes
With the latest GroupDocs.Signature for .NET version, we have consolidated Code39Standard
and Code93Extended
into their base types, Code39
and Code93
, respectively, to improve consistency and align with industry standards. Additionally, the available barcode options are extended by adding support for RectMicroQR
and MicroQR
types. Check out the following code example to learn how to use Code39
barcodes in your C# apps.
static BarcodeSignOptions GetBarcodeSignOptions()
{
BarcodeSignOptions result = new BarcodeSignOptions("123456789012", BarcodeTypes.Code39);
// alignment settings
result.Left = 100;
result.Top = 50;
result.Width = 200;
result.Height = 120;
result.AllPages = true;
result.PageNumber = 1;
result.PagesSetup = new PagesSetup() { FirstPage = true, LastPage = false, OddPages = true, EvenPages = false, PageNumbers = { 1, 2, 3 } };
result.HorizontalAlignment = Domain.HorizontalAlignment.Right;
result.VerticalAlignment = Domain.VerticalAlignment.Top;
// border settings
result.Border.Color = System.Drawing.Color.Red;
result.Border.DashStyle = GroupDocs.Signature.Domain.DashStyle.DashLongDash;
result.Border.Transparency = 0.8;
result.Border.Weight = 2;
result.Border.Visible = true;
// background settings
result.Background.Color = System.Drawing.Color.Yellow;
result.Background.Transparency = 0.5;
result.ForeColor = System.Drawing.Color.Green;
return result;
}
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting GroupDocs.Signature for .NET 24.7 Release Notes.