Category: .NET

PDF2PDFA .NET Converter Component – Version 1.1.0

Conversion to PDF/A-1a, 2a, 3a:

As of version 1.1.0, PDF files can now also be converted to PDF/A-1a, 2a and 3a. It should be noted, however, that not every PDF file can be converted and that an automatic conversion is only possible or only meaningful if the input file already contains the required structure information / tags. For example a PDF file can be created from MS-Word via the “Save as / PDF” function which already contains this required additional structure.

     

ZUGFeRD – Level configurable:

The ZUGFeRD standard supports 3 different levels – BASIC, COMFORT and EXTENDED. There is now a parameter that can be used to specify which level corresponds to the XML to be embedded. This information is then also transferred to the PDF metadata.

 

Download – Demo & Test application – PDF2PDFA Converter >>>

PDFSign – .NET Signature component including C # Sample project for PDF, PDF/A and ZUGFeRD

PDFSign is used to sign PDF documents with an X.509 certificate. In addition to the single signature, larger quantities of documents can also be signed in the stack in a time-saving manner. Since the signing also guarantees that a document has not been changed afterwards, the signing must always be the last step of the document creation. A subsequent change would render the signature invalid.

   

PDFSign features:

  • PKI compatibility: PDFSign is completely PKI neutral and works with PKI components from any vendor, including CAs, certificates, CRLs, SmartCards, etc. The access and use of the certificates and associated private keys can be done via SmartCards, USB Token or PFX files. Also, a signature processing is supported via Hardware Security Module (HSM), provided that they have an MS-CAPI or PKCS # 11 interface.
  • PDF/A or ZUGFERD documents remain valid: PDFSign ensures that the PDF/A or ZUGFeRD compliance is maintained even when applying the (visible) signature.

  • Billing signatures: The PDF / A and ZUGFeRD PDFSign compatible signatures can be used to digitally sign both individual (interactive) and larger quantities (batch processing) of invoices. An EU Directive states that invoices sent electronically by all Member States are to be accepted if the authenticity (origin) and integrity (unalterability) can be ensured.
  • PAdES Standard: PDFSign is compatible with PAdES part 2 and PAdES-LTV (long-term validation) standard. The revocation information of the certificates is embedded (PAdES-LTV).
  • Long-term validation: With PDFSign, a long-term validation document can be signed and stamped with a time stamp. PDFSign supports advanced digital signatures that contain embedded RFC 3161 compliant secure time stamps. Such certificates may also be verified after expiry of the validity and after revocation of the certificate.
  • CAdES-T (time stamp) Support – CMS Advanced Electronic Signature (CAdES) – CAdES-T (Timestamp), inserts trustworthy time stamps to protect against repelability. Signing and verifying very large CAdES signed files (100 MB and more)A time stamp helps to determine whether a document has not been modified after the signature. Like signatures, timestamps are easier to verify if they are associated with a certificate of a trustworthy time stamp instance.

  • SHA256, SHA512 Algorithm and RSA2048: PDFSign also supports the SHA256 and the SHA512 hash algorithm (known as SHA2) as well as RSA2048 as well as longer keys.
  • Encryption of PDF documents

  • PDF Document confirmation: This electronic confirmation can be used to indicate that the content of the document has been checked and approved.
  • Signature display configurable: PDFSign offers all possibilities to configure the visual representation of the visibly displayed signature. In addition to a number of parameters, the position as well as the pages – first, last, all – can be defined.

PDFSign – X.509 Certificate Generator:

X.509 certificates form the basis of a public-key infrastructure (PKI). These are electronic legitimations, issued by a certification body (CA) and linked to a key pair consisting of a private and public key.

Digital certificates are typically issued by a trusted and certified institution (CA) that guarantees identity. These are delivered both on secure hardware such as SmartCard’s or USB token or as software certificatesWith PDFSign it is also possible to create self-signed certificates. These can be used exactly as official certificates, but they do not have any certification or assurance. Signed documents are technically equivalent could be rejected by third parties but not as trustworthy and reliable.

Functions – Certificate Generator:

  • Self-signed certificates, root or user certificates can be created and stored either in the Microsoft certificate store or as a PFX file.
  • SHA 256, SHA 512, RSA 2048, RSA 4096 Algorithms and key lengths can be used.
  • Key usage and extended key usage can be easily configured.
  • X.509 Certificates and their properties can be displayed.

PDFSign .NET component: The PDFSign .NET component can be used to develop Windows Server and desktop applications.

  • Visual Studio 2005 – 2012
  • Visual Studio 2013
  • Visual Studio 2015

programming languages

  • C#,
  • VB.NET,
  • ASP.NET,
  • Visual C++,
  • Windows PowerShell.

Supported Operating Systems:

Windows 7 or higher, including Windows Server 2012/2016 and Windows 10. PDFSign .NET component requires .NET Framework 3.5 or higher.

Downloadexecutable PDFSign 30 days test and demo application incl. C # project in SourceCode >>>

DownloadPDFSign – X.509 Certificate Generator – Standalone Version >>>

FileConverterPro Client – WCF service sample – C# application incl. source code

This client application is included in the FCpro setup and is installed with the FileConverterPro Server. With it all function available via web-service can be tried and tested. Beside the EXE the application is also available as C# source code project to integrate FCpro functions in own applications quick and easily.

Functions:

  • Configuration web-service URL for the FCpro server
  • “Connect” – client connects with the FCpro server and retrieves all available processing profiles.
  • Selection – processing profile
  • “Statistics” – available pages (Abbyy OCR license), pages in the queue, documents in the queue, average time per document in sec.
  • “Server info” – version number server, hash-code for licensing
  • Insertion of single or multiple documents for conversion per drag & drop
  • Display of the current document list (ID, label, status, download link or error message) – processing, processed, downloaded, error
  • “Delete list”
  • Display of parallel upload processes
  • “Delete job”
  • For single conversions: direct synchron conversion – without job queue and polling

WS1_FCpro - Web-Service Sample - Conversion by adding files by drag&drop

  • Job functions – The jobs are managed through a database and can be retrieved. With it there are filter functions for status, username, label and date (created and converted) available. The list can be sorted ascending or descending per filter. Displaying of the overall amount of jobs as well as amount of pages and jobs per page. The job list can be retrieved page per page. Single jobs can be “aborted” or “deleted”. Also all jobs can be deleted. Display of the job list with user, date/time -created, -converted, ID, label, status, error.

WS2_FCpro - Web-Service Sample - Jobs

  • Admin service functions – for the admin an own web-service URL is available which can be addressed and used independent of the normal processing functions.
    • Configuration of the admin URL
    • “Connect” with the admin service
    • “start” and “stop” of the windows services on the FCpro server
    • Status request of the windows services – “started” or “stopped”
    • User – display of all users and their rights
    • Add new user – name, password, rights
    • Edit existing users
    • Delete users
    • Processing profiles – display list (name, OCR engine, description)
    • Upload new processing profile / replace existing profile (fcprox)
    • Download existing processing profile (fcprox)
    • Delete processing profile

WS3_FCpro - Web-Service Sample - Administration Service

  • Authentification – set username & password for the connection with the FCpro server.

WS4_FCPro - Web-Service Sample - Authentication

Download – FileConverterPro – web-service – C# sample project >>>

.NET Runtime – Version 3.5 required

The .NET Runtime version 3.5 is standardized installed on the Microsoft operating systems MS-Windows 7 and MS-Windows Server 2008 R2. On MS-Windows 8 / 8.1 as well as MS-Windows Server 2012 already .NET Framework 4.5 is used and delivered. The versions aren’t backward compatible so if a software is compiled for the version 3.5, the .NET Runtime 3.5 has to be installed on the PC.

Almost any of our applications requires the .NET Runtime version 3.5.

Therefor they can be instantly installed on Windows 7 while on Windows 8 / 8.1 the .NET Runtime 3.5 has to be activated and installed first. An automatic activation and installation through the setup isn’t working properly, therefor this step has to be done before the software installation.

Under Windows 8 / 8.1 the .NET Runtime 3.5 be activated as “Windows Feature” directly from the control panel.

Windows 8 - activate Windows Features  activate .NET framework 3.5

Only the eDocPrintPro, -PDF/A, -ZUGFeRD – setups work with both .NET versions – the setup recognizes under which OS the application runs and installs the corresponding version.

Office2PDFA – Scripting Support

Office2PDFA now also supports scripting. It supports two CLR languages: VB.NET & C#.  CLR = Common Language Routines, ie. C# and VB.NET are based on (implements the) Common Language Routines – there are other CLR programming languages J#, IronPhyton. VBScript is also supported but only for 32bit version.

It is possible to execute script before, and after the conversion. The script execution can be enabled/disabled. The scripts for before and after can be written in different programming languages.

A script consists of a list of functions and declarations. The runtime will generate a class from the functions and declarations and will execute the “Run” method. The Run method has one parameter of type IScriptContext.

IScriptContext properties:

  • SkipConversion (boolean): if the value is set to true, the application will not convert the document to PDF. The script is responsible to convert the document and write the result to a temporary folder. The path of the temportary folder should be stored in the DestinationFile property. The destination file type (extension) should be specified also from the script,  using the DestinationFileExt property.
  • DestinationFile (string): the fully qualified path of a file
  • DestinationFileExt (string): the extension of the destination file
  • FolderPath: the path of the folder of the input file
  • RootFolderPath: the root folder path, it can be different than the FolderPath property in the case if the subfolder monitoring is enabled
  • Error (boolean): the script should set this property some errors are occured.
  • ErrorDescription (string): the script should set this property and provide a description of the error.
  • FilePath: the fully qualified path of the source file
  • Folder (IFolder): a reference to an Office2PDF monitored folder.

Folder properties – use this object to get additional information about the monitored folder:

  • Name (the name of the monitored folder)
  • InputFolder (path to the input folder)
  • OutputFolder (path of the output foldre)
  • ErrorFolder (error folder)
  • ArchiveFolder (archive folder)

Sample VB.NET Script to convert a MS-Word DOCX to a DOC document – The following pre-script can be used to convert DOCX documents to DOC:

Download – Sample script to convert DOCX to DOC >>>

It is also possible to specify additional assembly references which are used by the scripts. For this script we used the following references:

  • System.Windows.Forms.dll
  • System.Data.dll
  • System.Drawing.dll
  • System.Xml.dll
  • Microsoft.VisualBasic.dll

The workflow of the Office2PDFA remains, the destination file is handled like a normal PDF conversion result. All options are available. PDF metadata, and other PDF properties cannot be applied.

Office2PDFA_Scripting_sample_docx_to_doc_#1 Office2PDFA_Scripting_sample_docx_to_doc_#2

Additional info about IScriptContext which is used by the Run method

It has 2 additional methods:

  • GetParam(name, defValue)
  • SetParam(name, value)

You can store in the IScriptContext parameter your script state data if you want to transmit some data from the pre-script to the post-script, because the same IScriptContext object is used for both scripts to ensure the correct workflow.

The post action script’s parameter contains all information about:

  • the source file/folder, subfolder
  • the desitnation file/folder, subfolder
  • the error (if any)

It is possible to use only the „post“ action script, or only the „pre“ script or both. Scripts can be written in C#, VB.NET or VBScript.  All features of the .NET framework and all features of these programming languages are available. The script security context (Evidence) is the security context of the Office2PDFA application. That means that the script will have the same security context like the application.

 

Office2PDFA also supports VBScript:

The method signature should look like:

sub Run(byref context)
end sub

all parameters are also available with VBScript

Webshop