Information for Developers of Tax Prep Software — Intelligent Tax Documents®

 

PDF versions of annual tax documents may "electronically deliver" tax data by embedding FDX JSON in the PDF "custom properties".

Such PDF files are referred to as intelligent tax documents®.

As seen below, the tax document information in FDX-standard JSON format is included internally in the PDF file.

How to read FDX JSON from PDF tax documents

Example Java code


import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDDocumentInformation;

import java.io.File;

public class PdfFdxJsonReader {

    private String fdxJson;
    private String fdxVersion;
    private String fdxSoftwareId;

    public String getFdxJson( ) {
        return fdxJson;
    }

    public String getFdxVersion( ) {
        return fdxVersion;
    }

    public String getFdxSoftwareId( ) {
        return fdxSoftwareId;
    }

    public void read( String pdfInFilePath ) {

        try (
            PDDocument document = PDDocument.load( new File( pdfInFilePath ) );
        ) {

            PDDocumentInformation info = document.getDocumentInformation( );
            if ( info == null ) {
                return;
            }

            this.fdxJson = info.getCustomMetadataValue( "fdxJson" );
            this.fdxVersion = info.getCustomMetadataValue( "fdxVersion" );
            this.fdxSoftwareId = info.getCustomMetadataValue( "fdxSoftwareId" );

        } catch ( Exception e ) {

            System.out.println( e.getMessage( ) );

        }

    }

}

© Copyright 2024. All Rights Reserved.