'' This code is part of Document Solutions for PDF demos.
'' Copyright (c) MESCIUS inc. All rights reserved.
Imports System.IO
Imports System.Drawing
Imports System.Collections.Generic
Imports System.Linq
Imports GrapeCity.Documents.Pdf
Imports GrapeCity.Documents.Text

'' 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.
Public Class FillForms
    '' By default, generate the first form:
    Public Sub CreatePDF(ByVal stream As Stream, Optional ByVal paramsIdx As Integer = 0)
        CreatePDF(stream, GetSampleParamsList()(paramsIdx))
    End Sub

    Public Sub CreatePDF(ByVal stream As Stream, ByVal sampleParams As String())
        Dim fn = sampleParams(3)
        Dim pn = Path.Combine("Resources", "PDFs", "Forms", "misc", fn)
        Using fs = File.OpenRead(pn)
        End Using
    End Sub

    Public Shared Function GetSampleParamsList() As List(Of String())
        '' Strings are name, description, info, rest are arbitrary strings:
        Return New List(Of String()) From
                New String() {"@us-tax-forms/Form W-7", "Application for IRS Individual Taxpayer Identification Number", Nothing, "fw7-demo.pdf"},
                New String() {"@us-tax-forms/Form SS-4", "Application for Employer Identification Number", Nothing, "fss4-demo.pdf"},
                New String() {"@e-com-forms/Goods Return", "Goods Return and Exchange Form", Nothing, "goods-return-form.pdf"},
                New String() {"@hr-forms/Time Sheet", "Time Sheet Form", Nothing, "time-sheet-form.pdf"},
                New String() {"@hr-forms/Trip Permission", "Offsite field trip permission slip", Nothing, "offsite-field-trip-form.pdf"},
                New String() {"@member-forms/Health Info", "Health Info Intake Form", Nothing, "health-intake-form.pdf"},
                New String() {"@event-forms/Event Feedback", "Event Feedback Form", Nothing, "event-feedback-form.pdf"}
    End Function
End Class