//// This code is part of Document Solutions for PDF .NET demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingSystem.Collections.Generic; namespaceDsPdfWeb.Demos{// This sample provides a number of forms that can be filled// and saved or printed right in the sample browser// using the 'save' or 'print' buttons in DsPdfViewer.//// Note that if you print the filled form, everything is done// in the client browser, no data is sent to our demo server.// But if you click the 'save' button, the entered data along with// the original form are sent to the demo server. The server uses DsPdf// to insert the data into the PDF, and sends the filled PDF form// back to the client. The demo server neither stores nor analyzes// the data.//// Note also that the viewer's 'download' button will only download// the original form without the data. Unlike the 'save' button, 'download'// does not access the server, it only gets the original PDF that was loaded// into the viewer.publicclassFillForms {// By default, generate the first form:publicvoidCreatePDF(Stream stream, int paramsIdx = 0) {CreatePDF(stream, GetSampleParamsList()[paramsIdx]); } publicvoidCreatePDF(Stream stream, string[] sampleParams) {var fn = sampleParams[3];var pn = Path.Combine("Resources", "PDFs", "Forms", "misc", fn);using (var fs = File.OpenRead(pn)) fs.CopyTo(stream); } publicstaticList<string[]> GetSampleParamsList() {// Strings are name, description, info, rest are arbitrary strings:returnnewList<string[]>() {newstring[] { "@us-tax-forms/Form W-7", "Application for IRS Individual Taxpayer Identification Number", "", "fw7-demo.pdf" },newstring[] { "@us-tax-forms/Form SS-4", "Application for Employer Identification Number", null, "fss4-demo.pdf" },newstring[] { "@e-com-forms/Goods Return", "Goods Return and Exchange Form", null, "goods-return-form.pdf" },newstring[] { "@hr-forms/Time Sheet", "Time Sheet Form", null, "time-sheet-form.pdf" },newstring[] { "@hr-forms/Trip Permission", "Offsite field trip permission slip", null, "offsite-field-trip-form.pdf" },newstring[] { "@member-forms/Health Info", "Health Info Intake Form", null, "health-intake-form.pdf" },newstring[] { "@event-forms/Event Feedback", "Event Feedback Form", null, "event-feedback-form.pdf" }, }; } // Used by SupportApiDemo to initialize DsPdfViewer.publicstaticGcPdfViewerSupportApiDemo.Models.PdfViewerOptionsPdfViewerOptions {get => newGcPdfViewerSupportApiDemo.Models.PdfViewerOptions(GcPdfViewerSupportApiDemo.Models.PdfViewerOptions.Options.FormEditorPanel); } }}