Sign document with HIBC PAS barcode Symbology
Leave feedback
On this page
GroupDocs.Signature provides the HIBCPASData class (package com.groupdocs.signature.domain.extensions.hibcpas) to create HIBC PAS barcode, designed specifically to meet the stringent requirements of the healthcare industry.
Here are the steps how to add HIBC PAS barcode signature into document with GroupDocs.Signature:
Create new instance of Signature class and pass source document path as a constructor parameter.
Instantiate the HIBCPASData class. Set the data location with the setDataLocation method (a HIBCPASDataLocation constant) and add records with the addRecord method (a HIBCPASDataType constant and the value).
Instantiate the QrCodeSignOptions object with all required additional options and pass the HIBCPASData object to its setData method.
Analyze the SignResult result to check newly created signatures if needed.
This example shows how to add HIBCPASData signature to document using Java:
Signaturesignature=newSignature("sample.pdf");try{HIBCPASDatadata=newHIBCPASData();data.setDataLocation(HIBCPASDataLocation.Patient);data.addRecord(HIBCPASDataType.LabelerIdentificationCode,"A123");data.addRecord(HIBCPASDataType.ManufacturerSerialNumber,"SERIAL123");// create options
QrCodeSignOptionsoptions=newQrCodeSignOptions();options.setEncodeType(QrCodeTypes.QR);options.setLeft(100);options.setTop(100);// setup Data property to HIBCPASData instance
options.setData(data);// sign document to file
SignResultsignResult=signature.sign("signed.pdf",options);// analyzing result
System.out.println("List of newly created signatures:");intnumber=1;for(BaseSignaturetemp:signResult.getSucceeded()){System.out.println("Signature #"+number+++": Type: "+temp.getSignatureType()+" Id:"+temp.getSignatureId()+", Location: "+temp.getLeft()+"x"+temp.getTop()+". Size: "+temp.getWidth()+"x"+temp.getHeight());}}finally{signature.dispose();}
This example shows how to decode HIBCPASData signature from the document using Java. The getData method of QrCodeSignature takes the class of the expected object:
Signaturesignature=newSignature("signed.pdf");try{List<QrCodeSignature>signatures=signature.search(QrCodeSignature.class,SignatureType.QrCode);if(!signatures.isEmpty()){HIBCPASDatadata=signatures.get(0).getData(HIBCPASData.class);if(data!=null){System.out.println("HIBC PAS data location: "+data.getDataLocation());for(HIBCPASRecordrecord:data.getRecords()){System.out.println("\t"+record.getDataType()+" : "+record.getData());}}}}finally{signature.dispose();}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: