diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-02-20 12:03:32 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-02-20 12:04:54 +0100 |
commit | ab7a38ff2956d427b598704e9309912593ff1d87 (patch) | |
tree | 91e1151e07aaddd404c756fd13a7782c05783e49 /pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign | |
parent | 6f6a16cdd2a49f7b50e8b0d2b75ef768a323eee7 (diff) | |
download | pdf-as-4-ab7a38ff2956d427b598704e9309912593ff1d87.tar.gz pdf-as-4-ab7a38ff2956d427b598704e9309912593ff1d87.tar.bz2 pdf-as-4-ab7a38ff2956d427b598704e9309912593ff1d87.zip |
Added license text
Diffstat (limited to 'pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign')
15 files changed, 1722 insertions, 1377 deletions
diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java index 62b48227..5466d596 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java @@ -1,394 +1,417 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign;
-
-import java.util.Properties;
-
-import at.gv.egiz.pdfas.api.commons.Constants;
-import at.gv.egiz.pdfas.api.io.DataSink;
-import at.gv.egiz.pdfas.api.io.DataSource;
-import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning;
-import at.gv.egiz.pdfas.api.timestamp.TimeStamper;
-import at.knowcenter.wag.egov.egiz.sig.SignatureTypes;
-
-/**
- * Parameter object that holds the sign parameters.
- *
- * @author wprinz
- */
-@Deprecated
-public class SignParameters
-{
-// 23.11.2010 changed by exthex - added parameters for placeholder handling
-
- /**
- * The document to be signed.
- *
- * <p>
- * The DataSource implementation encapsulates the actual representaion of the
- * data. E.g. the DataSource may be File based or byte array based. See
- * package at.gv.egiz.pdfas.framework.input and at.gv.pdfas.impl.input
- * </p>
- */
- protected DataSource document = null;
-
- /**
- * The type of the signature.
- *
- * <p>
- * May be {@link Constants#SIGNATURE_TYPE_BINARY} or
- * {@link Constants#SIGNATURE_TYPE_TEXTUAL}.
- * </p>
- */
- protected String signatureType = Constants.DEFAULT_SIGNATURE_TYPE;
-
- /**
- * The signature device to perform the actual signature.
- *
- * <p>
- * May be {@link Constants#SIGNATURE_DEVICE_MOA} or
- * {@link Constants#SIGNATURE_DEVICE_BKU}.
- * </p>
- */
- protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA;
-
- /**
- * The signature profile identifier identifying the profile to be used in the
- * config file.
- *
- * <p>
- * Note: In near future it will be possible to provide a full specified
- * profile here instead of the profile id.
- * </p>
- */
- protected String signatureProfileId = null;
-
- /**
- * The signature key identifier specifying which signature key should be used
- * by the signature device to perform the signature.
- *
- * <p>
- * Providing a null value (default) means that no explicit signature key
- * identifier is provided. The selected signature device will then use its
- * default mechanism for retrieving this information (which is usually to read
- * the key from the provided signature profile).
- * </p>
- * <p>
- * Note that not all signature devices may support this parameter.
- * If a signature device doesn't support this parameter the value should be null.
- * </p>
- * <p>
- * This key is usually passed straight through to the signature device and
- * thereby has to contain an appropriate value for the signature device
- * chosen.
- * </p>
- * <p>
- * Currently, only the {@link Constants#SIGNATURE_DEVICE_MOA} signature device
- * evaluates this parameter and passes the provided String to MOA as the MOA
- * key group identifier. If null is provided, the MOA signature device will
- * determine the signature key identifier to be used from the provided profile
- * and, if not specified there either, from the MOA default configuration.
- * </p>
- */
- protected String signatureKeyIdentifier = null;
-
- /**
- * The signature position. Consult the PDF-AS documentation section
- * Commandline.
- */
- protected SignaturePositioning signaturePositioning = null;
-
- /**
- * The output DataSink that will receive the signed document.
- */
- protected DataSink output = null;
-
- protected TimeStamper timeStamperImpl;
-
- /**
- * The flag to de-/activate placeholder search
- */
- protected Boolean checkForPlaceholder = null;
-
- /**
- * The id of the placeholder which should be replaced.
- */
- protected String placeholderId;
-
- /**
- * The matching mode for placeholder extraction.<br/>
- * If a {@link SignParameters#placeholderId} is set, the match mode determines what is to be done, if no matching placeholder is found in the document.
- * <br/>
- * Defaults to {@link Constants#PLACEHOLDER_MATCH_MODE_MODERATE}.
- */
- protected int placeholderMatchMode = Constants.PLACEHOLDER_MATCH_MODE_MODERATE;
-
- protected Properties overrideProps = new Properties();
-
-
-
-
-
- /**
- * {@link #setTimeStamperImpl(TimeStamper)}
- * @return
- */
- public TimeStamper getTimeStamperImpl() {
- return this.timeStamperImpl;
- }
-
- /**
- * Set a {@link TimeStamper} to create a timestamp on the signature value. Will be
- * called after sign. For binary signatures only. Timestamp will be embedded in egiz dict /TimeStamp.
- * @param timeStamperImpl
- */
- public void setTimeStamperImpl(TimeStamper timeStamperImpl) {
- this.timeStamperImpl = timeStamperImpl;
- }
-
-/**
- * @return the document
- */
- public DataSource getDocument()
- {
- return document;
- }
-
- /**
- * @param document
- * the document to set
- */
- public void setDocument(DataSource document)
- {
- this.document = document;
- }
-
- /**
- * @return the signatureType
- */
- public String getSignatureType()
- {
- return signatureType;
- }
-
- /**
- * @param signatureType
- * the signatureType to set
- */
- public void setSignatureType(String signatureType)
- {
- this.signatureType = signatureType;
- }
-
- /**
- * @return the signatureDevice
- */
- public String getSignatureDevice()
- {
- return signatureDevice;
- }
-
- /**
- * @param signatureDevice
- * the signatureDevice to set
- */
- public void setSignatureDevice(String signatureDevice)
- {
- this.signatureDevice = signatureDevice;
- }
-
- /**
- * @return the signatureProfileId
- */
- public String getSignatureProfileId()
- {
- return signatureProfileId;
- }
-
- /**
- * @param signatureProfileId
- * the signatureProfileId to set
- */
- public void setSignatureProfileId(String signatureProfileId)
- {
- this.signatureProfileId = signatureProfileId;
- }
-
- /**
- * @return the signaturePositioning
- */
- public SignaturePositioning getSignaturePositioning()
- {
- return this.signaturePositioning;
- }
-
- /**
- * @param signaturePositioning
- * the signaturePositioning to set
- */
- public void setSignaturePositioning(SignaturePositioning signaturePositioning)
- {
- this.signaturePositioning = signaturePositioning;
- }
-
- /**
- * @return the output
- */
- public DataSink getOutput()
- {
- return output;
- }
-
- /**
- * @param output
- * the output to set
- */
- public void setOutput(DataSink output)
- {
- this.output = output;
- }
-
- /**
- * @return the signatureKeyIdentifier
- */
- public String getSignatureKeyIdentifier()
- {
- return this.signatureKeyIdentifier;
- }
-
- /**
- * @param signatureKeyIdentifier the signatureKeyIdentifier to set
- */
- public void setSignatureKeyIdentifier(String signatureKeyIdentifier)
- {
- this.signatureKeyIdentifier = signatureKeyIdentifier;
- }
-
- /**
- * Override user defined values from the used signature profile like "value.SIG_META".
- * You cannot override pre defined values like SIG_VALUE, SIG_DATE {@link SignatureTypes#REQUIRED_SIG_KEYS}.
- * The override values are bound to the {@link SignParameters} instance.
- * <p>
- * Sample usage:
- * <pre>
- SignParameters sp = new SignParameters();
- . . .
-
- sp.setSignatureProfileId("SIGNATURBLOCK_DE");
-
- // expressions do not work on binary signature fields without phlength setting!!
- sp.setProfileOverrideValue("SIG_META", "It's nice to be important, but it is more important to be nice ${subject.L}");;
- sp.setProfileOverrideValue("SIG_LABEL", "./images/signatur-logo_en.png");
-
- // execute sign using the overrides
- pdfAs.sign(sp);
- </pre>
- * </p>
- * @param key the name of the setting to override e.g. "SIG_META"
- * @param value The new value
- */
- public void setProfileOverrideValue(String key, String value) {
- if (SignatureTypes.isRequredSigTypeKey(key)) {
- throw new RuntimeException("cannot set value for pre defined signature field names");
- }
- this.overrideProps.put(key, value);
- }
-
- /**
- * Get override values created via {@link #setProfileOverrideValue(String, String)}
- * @return
- */
- public Properties getProfileOverrideProperties() {
- return this.overrideProps;
-
- }
-
- /**
- * Get the value of the checkForPlaceholder flag.
- *
- * @return
- */
- public Boolean isCheckForPlaceholder() {
- return this.checkForPlaceholder;
- }
-
- /**
- * Set this to true, if you want a search for placeholder images to be performed and
- * appropriate images to be replaced.
- * If this is not set, a search will only be performed if the configuration property "enable_placeholder_search" is set to true.
- *
- * @param check
- */
- public void setCheckForPlaceholder(Boolean searchForPlaceHolder) {
- this.checkForPlaceholder = searchForPlaceHolder;
- }
-
- /**
- * Set an explicit placeholder id.
- * Only placeholder images that have a matching ID property embedded will be considered for replacement.
- *
- * @param placeholderId
- */
- public void setPlaceholderId(String placeholderId) {
- this.placeholderId = placeholderId;
- }
-
- /**
- * The id of the placeholder to replace.
- *
- * @return the placeholderId
- */
- public String getPlaceholderId() {
- return placeholderId;
- }
-
- /**
- * Set the behavior if no exactly matching placeholder could be found.<br/>
- * Exactly matching meaning:<br/>
- * <ul><li>If a placeholderId is set: a placeholder which has exactly this id embedded</li>
- * <li>If no placeholderId is set: a placeholder without an embedded id is found</li></ul>
- *
- * @see Constants#PLACEHOLDER_MATCH_MODE_LENIENT
- * @see Constants#PLACEHOLDER_MATCH_MODE_MODERATE
- * @see Constants#PLACEHOLDER_MATCH_MODE_STRICT
- *
- * Defaults to {@link Constants#PLACEHOLDER_MATCH_MODE_MODERATE}.
- *
- * @param placeholderMatchMode
- */
- public void setPlaceholderMatchMode(int placeholderMatchMode) {
- this.placeholderMatchMode = placeholderMatchMode;
- }
-
- /**
- * Get the placeholder matching mode.
- *
- * @see SignParameters#getPlaceholderMatchMode()
- * @return the placeholderMatchMode
- */
- public int getPlaceholderMatchMode() {
- return this.placeholderMatchMode;
- }
-
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign; + +import java.util.Properties; + +import at.gv.egiz.pdfas.api.commons.Constants; +import at.gv.egiz.pdfas.api.io.DataSink; +import at.gv.egiz.pdfas.api.io.DataSource; +import at.gv.egiz.pdfas.api.sign.pos.SignaturePositioning; +import at.gv.egiz.pdfas.api.timestamp.TimeStamper; +import at.knowcenter.wag.egov.egiz.sig.SignatureTypes; + +/** + * Parameter object that holds the sign parameters. + * + * @author wprinz + */ +@Deprecated +public class SignParameters +{ +// 23.11.2010 changed by exthex - added parameters for placeholder handling + + /** + * The document to be signed. + * + * <p> + * The DataSource implementation encapsulates the actual representaion of the + * data. E.g. the DataSource may be File based or byte array based. See + * package at.gv.egiz.pdfas.framework.input and at.gv.pdfas.impl.input + * </p> + */ + protected DataSource document = null; + + /** + * The type of the signature. + * + * <p> + * May be {@link Constants#SIGNATURE_TYPE_BINARY} or + * {@link Constants#SIGNATURE_TYPE_TEXTUAL}. + * </p> + */ + protected String signatureType = Constants.DEFAULT_SIGNATURE_TYPE; + + /** + * The signature device to perform the actual signature. + * + * <p> + * May be {@link Constants#SIGNATURE_DEVICE_MOA} or + * {@link Constants#SIGNATURE_DEVICE_BKU}. + * </p> + */ + protected String signatureDevice = Constants.SIGNATURE_DEVICE_MOA; + + /** + * The signature profile identifier identifying the profile to be used in the + * config file. + * + * <p> + * Note: In near future it will be possible to provide a full specified + * profile here instead of the profile id. + * </p> + */ + protected String signatureProfileId = null; + + /** + * The signature key identifier specifying which signature key should be used + * by the signature device to perform the signature. + * + * <p> + * Providing a null value (default) means that no explicit signature key + * identifier is provided. The selected signature device will then use its + * default mechanism for retrieving this information (which is usually to read + * the key from the provided signature profile). + * </p> + * <p> + * Note that not all signature devices may support this parameter. + * If a signature device doesn't support this parameter the value should be null. + * </p> + * <p> + * This key is usually passed straight through to the signature device and + * thereby has to contain an appropriate value for the signature device + * chosen. + * </p> + * <p> + * Currently, only the {@link Constants#SIGNATURE_DEVICE_MOA} signature device + * evaluates this parameter and passes the provided String to MOA as the MOA + * key group identifier. If null is provided, the MOA signature device will + * determine the signature key identifier to be used from the provided profile + * and, if not specified there either, from the MOA default configuration. + * </p> + */ + protected String signatureKeyIdentifier = null; + + /** + * The signature position. Consult the PDF-AS documentation section + * Commandline. + */ + protected SignaturePositioning signaturePositioning = null; + + /** + * The output DataSink that will receive the signed document. + */ + protected DataSink output = null; + + protected TimeStamper timeStamperImpl; + + /** + * The flag to de-/activate placeholder search + */ + protected Boolean checkForPlaceholder = null; + + /** + * The id of the placeholder which should be replaced. + */ + protected String placeholderId; + + /** + * The matching mode for placeholder extraction.<br/> + * If a {@link SignParameters#placeholderId} is set, the match mode determines what is to be done, if no matching placeholder is found in the document. + * <br/> + * Defaults to {@link Constants#PLACEHOLDER_MATCH_MODE_MODERATE}. + */ + protected int placeholderMatchMode = Constants.PLACEHOLDER_MATCH_MODE_MODERATE; + + protected Properties overrideProps = new Properties(); + + + + + + /** + * {@link #setTimeStamperImpl(TimeStamper)} + * @return + */ + public TimeStamper getTimeStamperImpl() { + return this.timeStamperImpl; + } + + /** + * Set a {@link TimeStamper} to create a timestamp on the signature value. Will be + * called after sign. For binary signatures only. Timestamp will be embedded in egiz dict /TimeStamp. + * @param timeStamperImpl + */ + public void setTimeStamperImpl(TimeStamper timeStamperImpl) { + this.timeStamperImpl = timeStamperImpl; + } + +/** + * @return the document + */ + public DataSource getDocument() + { + return document; + } + + /** + * @param document + * the document to set + */ + public void setDocument(DataSource document) + { + this.document = document; + } + + /** + * @return the signatureType + */ + public String getSignatureType() + { + return signatureType; + } + + /** + * @param signatureType + * the signatureType to set + */ + public void setSignatureType(String signatureType) + { + this.signatureType = signatureType; + } + + /** + * @return the signatureDevice + */ + public String getSignatureDevice() + { + return signatureDevice; + } + + /** + * @param signatureDevice + * the signatureDevice to set + */ + public void setSignatureDevice(String signatureDevice) + { + this.signatureDevice = signatureDevice; + } + + /** + * @return the signatureProfileId + */ + public String getSignatureProfileId() + { + return signatureProfileId; + } + + /** + * @param signatureProfileId + * the signatureProfileId to set + */ + public void setSignatureProfileId(String signatureProfileId) + { + this.signatureProfileId = signatureProfileId; + } + + /** + * @return the signaturePositioning + */ + public SignaturePositioning getSignaturePositioning() + { + return this.signaturePositioning; + } + + /** + * @param signaturePositioning + * the signaturePositioning to set + */ + public void setSignaturePositioning(SignaturePositioning signaturePositioning) + { + this.signaturePositioning = signaturePositioning; + } + + /** + * @return the output + */ + public DataSink getOutput() + { + return output; + } + + /** + * @param output + * the output to set + */ + public void setOutput(DataSink output) + { + this.output = output; + } + + /** + * @return the signatureKeyIdentifier + */ + public String getSignatureKeyIdentifier() + { + return this.signatureKeyIdentifier; + } + + /** + * @param signatureKeyIdentifier the signatureKeyIdentifier to set + */ + public void setSignatureKeyIdentifier(String signatureKeyIdentifier) + { + this.signatureKeyIdentifier = signatureKeyIdentifier; + } + + /** + * Override user defined values from the used signature profile like "value.SIG_META". + * You cannot override pre defined values like SIG_VALUE, SIG_DATE {@link SignatureTypes#REQUIRED_SIG_KEYS}. + * The override values are bound to the {@link SignParameters} instance. + * <p> + * Sample usage: + * <pre> + SignParameters sp = new SignParameters(); + . . . + + sp.setSignatureProfileId("SIGNATURBLOCK_DE"); + + // expressions do not work on binary signature fields without phlength setting!! + sp.setProfileOverrideValue("SIG_META", "It's nice to be important, but it is more important to be nice ${subject.L}");; + sp.setProfileOverrideValue("SIG_LABEL", "./images/signatur-logo_en.png"); + + // execute sign using the overrides + pdfAs.sign(sp); + </pre> + * </p> + * @param key the name of the setting to override e.g. "SIG_META" + * @param value The new value + */ + public void setProfileOverrideValue(String key, String value) { + if (SignatureTypes.isRequredSigTypeKey(key)) { + throw new RuntimeException("cannot set value for pre defined signature field names"); + } + this.overrideProps.put(key, value); + } + + /** + * Get override values created via {@link #setProfileOverrideValue(String, String)} + * @return + */ + public Properties getProfileOverrideProperties() { + return this.overrideProps; + + } + + /** + * Get the value of the checkForPlaceholder flag. + * + * @return + */ + public Boolean isCheckForPlaceholder() { + return this.checkForPlaceholder; + } + + /** + * Set this to true, if you want a search for placeholder images to be performed and + * appropriate images to be replaced. + * If this is not set, a search will only be performed if the configuration property "enable_placeholder_search" is set to true. + * + * @param check + */ + public void setCheckForPlaceholder(Boolean searchForPlaceHolder) { + this.checkForPlaceholder = searchForPlaceHolder; + } + + /** + * Set an explicit placeholder id. + * Only placeholder images that have a matching ID property embedded will be considered for replacement. + * + * @param placeholderId + */ + public void setPlaceholderId(String placeholderId) { + this.placeholderId = placeholderId; + } + + /** + * The id of the placeholder to replace. + * + * @return the placeholderId + */ + public String getPlaceholderId() { + return placeholderId; + } + + /** + * Set the behavior if no exactly matching placeholder could be found.<br/> + * Exactly matching meaning:<br/> + * <ul><li>If a placeholderId is set: a placeholder which has exactly this id embedded</li> + * <li>If no placeholderId is set: a placeholder without an embedded id is found</li></ul> + * + * @see Constants#PLACEHOLDER_MATCH_MODE_LENIENT + * @see Constants#PLACEHOLDER_MATCH_MODE_MODERATE + * @see Constants#PLACEHOLDER_MATCH_MODE_STRICT + * + * Defaults to {@link Constants#PLACEHOLDER_MATCH_MODE_MODERATE}. + * + * @param placeholderMatchMode + */ + public void setPlaceholderMatchMode(int placeholderMatchMode) { + this.placeholderMatchMode = placeholderMatchMode; + } + + /** + * Get the placeholder matching mode. + * + * @see SignParameters#getPlaceholderMatchMode() + * @return the placeholderMatchMode + */ + public int getPlaceholderMatchMode() { + return this.placeholderMatchMode; + } + +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignResult.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignResult.java index ad9b6cf8..e18d8105 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignResult.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignResult.java @@ -1,85 +1,108 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign;
-
-import java.security.cert.X509Certificate;
-import java.util.List;
-
-import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo;
-import at.gv.egiz.pdfas.api.io.DataSink;
-import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition;
-
-/**
- * The result of a sign operation.
- *
- * @author wprinz
- */
-@Deprecated
-public interface SignResult
-{
-
- /**
- * Returns the filled output data sink.
- *
- * @return Returns the filled output data sink.
- */
- public DataSink getOutputDocument();
-
- /**
- * Returns the certificate of the signer.
- *
- * @return Returns the certificate of the signer.
- */
- public X509Certificate getSignerCertificate();
-
- /**
- * Returns the position where the signature is finally placed.
- *
- * <p>
- * This information can be useful for post-processing the document.
- * </p>
- *
- * <p>
- * Consult the PDF-AS documentation section Commandline for further
- * information about positioning.
- * </p>
- *
- * @return Returns the position where the signature is finally placed. May
- * return null if no position information is available.
- */
- public SignaturePosition getSignaturePosition();
-
- /**
- * Returns a list<{@link NonTextObjectInfo} of non textual objects in the pdf document.
- * Only available for textual signatures. Show this to the user who signed the textual content only!
- * @return List<{@link NonTextObjectInfo} or <tt>null</tt> of not available (binary signature)
- */
- public List getNonTextualObjects();
-
- /**
- * Returns if pdf has non textual objects (only for textual signature available).
- * @return
- */
- public boolean hasNonTextualObjects();
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign; + +import java.security.cert.X509Certificate; +import java.util.List; + +import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo; +import at.gv.egiz.pdfas.api.io.DataSink; +import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition; + +/** + * The result of a sign operation. + * + * @author wprinz + */ +@Deprecated +public interface SignResult +{ + + /** + * Returns the filled output data sink. + * + * @return Returns the filled output data sink. + */ + public DataSink getOutputDocument(); + + /** + * Returns the certificate of the signer. + * + * @return Returns the certificate of the signer. + */ + public X509Certificate getSignerCertificate(); + + /** + * Returns the position where the signature is finally placed. + * + * <p> + * This information can be useful for post-processing the document. + * </p> + * + * <p> + * Consult the PDF-AS documentation section Commandline for further + * information about positioning. + * </p> + * + * @return Returns the position where the signature is finally placed. May + * return null if no position information is available. + */ + public SignaturePosition getSignaturePosition(); + + /** + * Returns a list<{@link NonTextObjectInfo} of non textual objects in the pdf document. + * Only available for textual signatures. Show this to the user who signed the textual content only! + * @return List<{@link NonTextObjectInfo} or <tt>null</tt> of not available (binary signature) + */ + public List getNonTextualObjects(); + + /** + * Returns if pdf has non textual objects (only for textual signature available). + * @return + */ + public boolean hasNonTextualObjects(); +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java index b4bba9a3..11b063ed 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/SignatureDetailInformation.java @@ -1,148 +1,171 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign;
-
-import java.security.cert.X509Certificate;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo;
-import at.gv.egiz.pdfas.api.io.DataSource;
-import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition;
-
-/**
- * A container for all relevant signature related data.
- *
- * @author exthex
- */
-@Deprecated
-public interface SignatureDetailInformation
-{
- public DataSource getSignatureData();
-
- /**
- * Returns the position where the signature table was actually placed.
- *
- * @return Returns the position where the signature table was actually placed.
- */
- public SignaturePosition getSignaturePosition();
-
- /**
- * Returns a list<{@link NonTextObjectInfo} of non textual objects in the pdf document.
- * Only available for textual signatures. Show this to the user who signed the textual content only!
- * @return List<{@link NonTextObjectInfo} or <tt>null</tt> of not available (binary signature)
- */
- public List getNonTextualObjects();
-
- /**
- * Returns the date of signature extracted from the signature.
- * @return
- */
- public Date getSignDate();
-
- /**
- * Get the name of the issuer.
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getIssuer()#getName()}
- *
- * @return
- */
- public String getIssuer();
-
- /**
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getIssuerDNMap()}
- *
- * @return
- */
- public Map getIssuerDNMap();
-
- /**
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getSubjectName()#toString()}
- *
- * @return
- */
- public String getSubjectName();
-
- /**
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getSerialNumber()#toString()}
- *
- * @return
- */
- public String getSerialNumber();
-
- /**
- * Get the algorithm the signature was created with.
- * @return
- */
- public String getSigAlgorithm();
-
- /**
- *
- * @return the signature id.
- */
- public String getSigID();
-
- /**
- *
- * @return the signature method.
- */
- public String getSigKZ();
-
- /**
- *
- * @return the signature value.
- */
- public String getSignatureValue();
-
- /**
- *
- * @return the signature time stamp.
- */
- public String getSigTimeStamp();
-
- /**
- * Short for {@link SignatureDetailInformation#getX509Certificate()#getSubjectDNMap()}
- *
- * @return
- */
- public Map getSubjectDNMap();
-
- /**
- *
- * @return the certificate used for signature.
- */
- public X509Certificate getX509Certificate();
-
- /**
- *
- * @return true if the signature is textual, false otherwise.
- */
- public boolean isTextual();
-
- /**
- *
- * @return true if this signature is binary, false otherwise.
- */
- public boolean isBinary();
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign; + +import java.security.cert.X509Certificate; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import at.gv.egiz.pdfas.api.analyze.NonTextObjectInfo; +import at.gv.egiz.pdfas.api.io.DataSource; +import at.gv.egiz.pdfas.api.sign.pos.SignaturePosition; + +/** + * A container for all relevant signature related data. + * + * @author exthex + */ +@Deprecated +public interface SignatureDetailInformation +{ + public DataSource getSignatureData(); + + /** + * Returns the position where the signature table was actually placed. + * + * @return Returns the position where the signature table was actually placed. + */ + public SignaturePosition getSignaturePosition(); + + /** + * Returns a list<{@link NonTextObjectInfo} of non textual objects in the pdf document. + * Only available for textual signatures. Show this to the user who signed the textual content only! + * @return List<{@link NonTextObjectInfo} or <tt>null</tt> of not available (binary signature) + */ + public List getNonTextualObjects(); + + /** + * Returns the date of signature extracted from the signature. + * @return + */ + public Date getSignDate(); + + /** + * Get the name of the issuer. + * Short for {@link SignatureDetailInformation#getX509Certificate()#getIssuer()#getName()} + * + * @return + */ + public String getIssuer(); + + /** + * Short for {@link SignatureDetailInformation#getX509Certificate()#getIssuerDNMap()} + * + * @return + */ + public Map getIssuerDNMap(); + + /** + * Short for {@link SignatureDetailInformation#getX509Certificate()#getSubjectName()#toString()} + * + * @return + */ + public String getSubjectName(); + + /** + * Short for {@link SignatureDetailInformation#getX509Certificate()#getSerialNumber()#toString()} + * + * @return + */ + public String getSerialNumber(); + + /** + * Get the algorithm the signature was created with. + * @return + */ + public String getSigAlgorithm(); + + /** + * + * @return the signature id. + */ + public String getSigID(); + + /** + * + * @return the signature method. + */ + public String getSigKZ(); + + /** + * + * @return the signature value. + */ + public String getSignatureValue(); + + /** + * + * @return the signature time stamp. + */ + public String getSigTimeStamp(); + + /** + * Short for {@link SignatureDetailInformation#getX509Certificate()#getSubjectDNMap()} + * + * @return + */ + public Map getSubjectDNMap(); + + /** + * + * @return the certificate used for signature. + */ + public X509Certificate getX509Certificate(); + + /** + * + * @return true if the signature is textual, false otherwise. + */ + public boolean isTextual(); + + /** + * + * @return true if this signature is binary, false otherwise. + */ + public boolean isBinary(); +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePosition.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePosition.java index f16d2ffb..ce73039f 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePosition.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePosition.java @@ -1,73 +1,96 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos;
-
-/**
- * Holds the actual, absolute signature position where a signature was placed.
- *
- * <p>
- * This is usually returned after signing.
- * </p>
- *
- * @author wprinz
- */
-@Deprecated
-public interface SignaturePosition
-{
- /**
- * Returns the page on which the signature was placed.
- *
- * @return Returns the page on which the signature was placed.
- */
- public int getPage();
-
- /**
- * Returns the x position.
- *
- * @return Returns the x position.
- */
- public float getX();
-
- /**
- * Returns the y position.
- *
- * @return Returns the y position.
- */
- public float getY();
-
- /**
- * Returns the width of the signature.
- *
- * @return Returns the width of the signature.
- */
- public float getWidth();
-
- /**
- * Returns the height of the signature.
- *
- * @return Returns the height of the signature.
- */
- public float getHeight();
-
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign.pos; + +/** + * Holds the actual, absolute signature position where a signature was placed. + * + * <p> + * This is usually returned after signing. + * </p> + * + * @author wprinz + */ +@Deprecated +public interface SignaturePosition +{ + /** + * Returns the page on which the signature was placed. + * + * @return Returns the page on which the signature was placed. + */ + public int getPage(); + + /** + * Returns the x position. + * + * @return Returns the x position. + */ + public float getX(); + + /** + * Returns the y position. + * + * @return Returns the y position. + */ + public float getY(); + + /** + * Returns the width of the signature. + * + * @return Returns the width of the signature. + */ + public float getWidth(); + + /** + * Returns the height of the signature. + * + * @return Returns the height of the signature. + */ + public float getHeight(); + +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java index 029d9022..ab5bb652 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/SignaturePositioning.java @@ -1,337 +1,360 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos;
-
-import java.io.Serializable;
-import java.util.StringTokenizer;
-
-import at.gv.egiz.pdfas.api.exceptions.ErrorCode;
-import at.gv.egiz.pdfas.api.exceptions.PdfAsException;
-import at.gv.egiz.pdfas.api.sign.pos.axis.AbsoluteAxisAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.axis.AutoAxisAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.axis.AxisAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.page.AbsolutePageAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.page.AutoPageAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.page.NewPageAlgorithm;
-import at.gv.egiz.pdfas.api.sign.pos.page.PageAlgorithm;
-
-/**
- * Defines how the signature positioning is to be performed.
- *
- * <p>
- * This positioning allows to select the location where the signature block is
- * placed in the document.
- * </p>
- *
- * @author wprinz
- */
-public class SignaturePositioning implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * The x axis algorithm.
- *
- * <p>
- * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
- * </p>
- */
- protected AxisAlgorithm xAlgorithm = new AutoAxisAlgorithm();
-
- /**
- * The y axis algorithm.
- *
- * <p>
- * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
- * </p>
- */
- protected AxisAlgorithm yAlgorithm = new AutoAxisAlgorithm();
-
- /**
- * The width algorithm.
- *
- * <p>
- * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm}
- * </p>
- */
- protected AxisAlgorithm widthAlgorithm = new AutoAxisAlgorithm();
-
- /**
- * The page algorithm.
- *
- * <p>
- * May be {@link AutoPageAlgorithm}, {@link AbsolutePageAlgorithm} or
- * {@link NewPageAlgorithm}
- * </p>
- */
- protected PageAlgorithm pageAlgorithm = new AutoPageAlgorithm();
-
- /**
- * Provides the position of the footline.
- *
- * <p>
- * Only used if the pageAlgorithm is {@link AutoPageAlgorithm} and the
- * yAlgorithm is {@link AutoAxisAlgorithm}
- * </p>
- */
- protected float footerLine = 0.0f;
-
- protected void checkAxisAlgorithm(AxisAlgorithm algorithm)
- {
- if (algorithm == null)
- {
- throw new IllegalArgumentException("The algorithm must not be null.");
- }
- if (!(algorithm instanceof AutoAxisAlgorithm) && !(algorithm instanceof AbsoluteAxisAlgorithm))
- {
- throw new IllegalArgumentException("The algorithm must be either Auto or Absolute.");
- }
- }
-
- protected void checkPageAlgorithm(PageAlgorithm algorithm)
- {
- if (algorithm == null)
- {
- throw new IllegalArgumentException("The algorithm must not be null.");
- }
- if (!(algorithm instanceof AutoPageAlgorithm) && !(algorithm instanceof AbsolutePageAlgorithm) && !(algorithm instanceof NewPageAlgorithm))
- {
- throw new IllegalArgumentException("The algorithm must be either Auto or Absolute.");
- }
-
- }
-
- /**
- * @return the xAlgorithm
- */
- public AxisAlgorithm getXAlgorithm()
- {
- return this.xAlgorithm;
- }
-
- /**
- * @param algorithm
- * the xAlgorithm to set
- */
- public void setXAlgorithm(AxisAlgorithm algorithm)
- {
- checkAxisAlgorithm(algorithm);
- xAlgorithm = algorithm;
- }
-
- /**
- * @return the yAlgorithm
- */
- public AxisAlgorithm getYAlgorithm()
- {
- return this.yAlgorithm;
- }
-
- /**
- * @param algorithm
- * the yAlgorithm to set
- */
- public void setYAlgorithm(AxisAlgorithm algorithm)
- {
- checkAxisAlgorithm(algorithm);
-
- yAlgorithm = algorithm;
- }
-
- /**
- * @return the widthAlgorithm
- */
- public AxisAlgorithm getWidthAlgorithm()
- {
- return this.widthAlgorithm;
- }
-
- /**
- * @param widthAlgorithm
- * the widthAlgorithm to set
- */
- public void setWidthAlgorithm(AxisAlgorithm widthAlgorithm)
- {
- checkAxisAlgorithm(widthAlgorithm);
-
- this.widthAlgorithm = widthAlgorithm;
- }
-
- /**
- * @return the pageAlgorithm
- */
- public PageAlgorithm getPageAlgorithm()
- {
- return this.pageAlgorithm;
- }
-
- /**
- * @param pageAlgorithm
- * the pageAlgorithm to set
- */
- public void setPageAlgorithm(PageAlgorithm pageAlgorithm)
- {
- checkPageAlgorithm(pageAlgorithm);
- this.pageAlgorithm = pageAlgorithm;
- }
-
- /**
- * @return the footerLine
- */
- public float getFooterLine()
- {
- return this.footerLine;
- }
-
- /**
- * @param footerLine
- * the footerLine to set
- */
- public void setFooterLine(float footerLine)
- {
- this.footerLine = footerLine;
- }
-
- public SignaturePositioning() {
- }
-
- public SignaturePositioning(String position) throws PdfAsException {
- if (position != null) {
- StringTokenizer tokenizer = new StringTokenizer(position, ";");
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken().replaceAll(" ", "");
- String[] sToken = token.split(":");
- if (sToken == null || sToken.length != 2 || sToken[0].length() != 1) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- char cmd = sToken[0].toLowerCase().charAt(0);
- String value = sToken[1];
- switch (cmd) {
- case 'x':
- if ("auto".equalsIgnoreCase(value)) {
- this.setXAlgorithm(new AutoAxisAlgorithm());
- } else {
- try {
- this.setXAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value)));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- break;
- case 'y':
- if ("auto".equalsIgnoreCase(value)) {
- this.setYAlgorithm(new AutoAxisAlgorithm());
- } else {
- try {
- this.setYAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value)));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- break;
- case 'w':
- if ("auto".equalsIgnoreCase(value)) {
- this.setWidthAlgorithm(new AutoAxisAlgorithm());
- } else {
- try {
- this.setWidthAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value)));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- break;
- case 'p':
- if ("auto".equalsIgnoreCase(value)) {
- this.setPageAlgorithm(new AutoPageAlgorithm());
- } else if ("new".equalsIgnoreCase(value)) {
- this.setPageAlgorithm(new NewPageAlgorithm());
- } else {
- try {
- this.setPageAlgorithm(new AbsolutePageAlgorithm(Integer.parseInt(value)));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- break;
- case 'f':
- try {
- this.setFooterLine(Float.parseFloat(value));
- } catch (NumberFormatException e) {
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- break;
- default:
- throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token);
- }
- }
- }
- }
-
- public String getPositionString() {
- StringBuilder sb = new StringBuilder();
- AxisAlgorithm xAlgo = getXAlgorithm();
-
- if(xAlgo instanceof AutoAxisAlgorithm) {
- sb.append("x:auto;");
- } else if(xAlgo instanceof AbsoluteAxisAlgorithm) {
- sb.append("x:" + ((AbsoluteAxisAlgorithm)xAlgo).getAbsoluteValue() + ";");
- }
-
- AxisAlgorithm yAlgo = getXAlgorithm();
-
- if(yAlgo instanceof AutoAxisAlgorithm) {
- sb.append("y:auto;");
- } else if(yAlgo instanceof AbsoluteAxisAlgorithm) {
- sb.append("y:" + ((AbsoluteAxisAlgorithm)yAlgo).getAbsoluteValue() + ";");
- }
-
- AxisAlgorithm wAlgo = getWidthAlgorithm();
-
- if(wAlgo instanceof AutoAxisAlgorithm) {
- sb.append("w:auto;");
- } else if(wAlgo instanceof AbsoluteAxisAlgorithm) {
- sb.append("w:" + ((AbsoluteAxisAlgorithm)wAlgo).getAbsoluteValue() + ";");
- }
-
- PageAlgorithm pAlgo = getPageAlgorithm();
-
- if(pAlgo instanceof AutoPageAlgorithm) {
- sb.append("p:auto;");
- } else if(pAlgo instanceof NewPageAlgorithm) {
- sb.append("p:new;");
- }
-
- float footerLine = getFooterLine();
-
- sb.append("f:" + + footerLine);
-
- return sb.toString();
- }
-
-
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign.pos; + +import java.io.Serializable; +import java.util.StringTokenizer; + +import at.gv.egiz.pdfas.api.exceptions.ErrorCode; +import at.gv.egiz.pdfas.api.exceptions.PdfAsException; +import at.gv.egiz.pdfas.api.sign.pos.axis.AbsoluteAxisAlgorithm; +import at.gv.egiz.pdfas.api.sign.pos.axis.AutoAxisAlgorithm; +import at.gv.egiz.pdfas.api.sign.pos.axis.AxisAlgorithm; +import at.gv.egiz.pdfas.api.sign.pos.page.AbsolutePageAlgorithm; +import at.gv.egiz.pdfas.api.sign.pos.page.AutoPageAlgorithm; +import at.gv.egiz.pdfas.api.sign.pos.page.NewPageAlgorithm; +import at.gv.egiz.pdfas.api.sign.pos.page.PageAlgorithm; + +/** + * Defines how the signature positioning is to be performed. + * + * <p> + * This positioning allows to select the location where the signature block is + * placed in the document. + * </p> + * + * @author wprinz + */ +public class SignaturePositioning implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * The x axis algorithm. + * + * <p> + * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm} + * </p> + */ + protected AxisAlgorithm xAlgorithm = new AutoAxisAlgorithm(); + + /** + * The y axis algorithm. + * + * <p> + * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm} + * </p> + */ + protected AxisAlgorithm yAlgorithm = new AutoAxisAlgorithm(); + + /** + * The width algorithm. + * + * <p> + * May be {@link AutoAxisAlgorithm} or {@link AbsoluteAxisAlgorithm} + * </p> + */ + protected AxisAlgorithm widthAlgorithm = new AutoAxisAlgorithm(); + + /** + * The page algorithm. + * + * <p> + * May be {@link AutoPageAlgorithm}, {@link AbsolutePageAlgorithm} or + * {@link NewPageAlgorithm} + * </p> + */ + protected PageAlgorithm pageAlgorithm = new AutoPageAlgorithm(); + + /** + * Provides the position of the footline. + * + * <p> + * Only used if the pageAlgorithm is {@link AutoPageAlgorithm} and the + * yAlgorithm is {@link AutoAxisAlgorithm} + * </p> + */ + protected float footerLine = 0.0f; + + protected void checkAxisAlgorithm(AxisAlgorithm algorithm) + { + if (algorithm == null) + { + throw new IllegalArgumentException("The algorithm must not be null."); + } + if (!(algorithm instanceof AutoAxisAlgorithm) && !(algorithm instanceof AbsoluteAxisAlgorithm)) + { + throw new IllegalArgumentException("The algorithm must be either Auto or Absolute."); + } + } + + protected void checkPageAlgorithm(PageAlgorithm algorithm) + { + if (algorithm == null) + { + throw new IllegalArgumentException("The algorithm must not be null."); + } + if (!(algorithm instanceof AutoPageAlgorithm) && !(algorithm instanceof AbsolutePageAlgorithm) && !(algorithm instanceof NewPageAlgorithm)) + { + throw new IllegalArgumentException("The algorithm must be either Auto or Absolute."); + } + + } + + /** + * @return the xAlgorithm + */ + public AxisAlgorithm getXAlgorithm() + { + return this.xAlgorithm; + } + + /** + * @param algorithm + * the xAlgorithm to set + */ + public void setXAlgorithm(AxisAlgorithm algorithm) + { + checkAxisAlgorithm(algorithm); + xAlgorithm = algorithm; + } + + /** + * @return the yAlgorithm + */ + public AxisAlgorithm getYAlgorithm() + { + return this.yAlgorithm; + } + + /** + * @param algorithm + * the yAlgorithm to set + */ + public void setYAlgorithm(AxisAlgorithm algorithm) + { + checkAxisAlgorithm(algorithm); + + yAlgorithm = algorithm; + } + + /** + * @return the widthAlgorithm + */ + public AxisAlgorithm getWidthAlgorithm() + { + return this.widthAlgorithm; + } + + /** + * @param widthAlgorithm + * the widthAlgorithm to set + */ + public void setWidthAlgorithm(AxisAlgorithm widthAlgorithm) + { + checkAxisAlgorithm(widthAlgorithm); + + this.widthAlgorithm = widthAlgorithm; + } + + /** + * @return the pageAlgorithm + */ + public PageAlgorithm getPageAlgorithm() + { + return this.pageAlgorithm; + } + + /** + * @param pageAlgorithm + * the pageAlgorithm to set + */ + public void setPageAlgorithm(PageAlgorithm pageAlgorithm) + { + checkPageAlgorithm(pageAlgorithm); + this.pageAlgorithm = pageAlgorithm; + } + + /** + * @return the footerLine + */ + public float getFooterLine() + { + return this.footerLine; + } + + /** + * @param footerLine + * the footerLine to set + */ + public void setFooterLine(float footerLine) + { + this.footerLine = footerLine; + } + + public SignaturePositioning() { + } + + public SignaturePositioning(String position) throws PdfAsException { + if (position != null) { + StringTokenizer tokenizer = new StringTokenizer(position, ";"); + while (tokenizer.hasMoreTokens()) { + String token = tokenizer.nextToken().replaceAll(" ", ""); + String[] sToken = token.split(":"); + if (sToken == null || sToken.length != 2 || sToken[0].length() != 1) { + throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token); + } + char cmd = sToken[0].toLowerCase().charAt(0); + String value = sToken[1]; + switch (cmd) { + case 'x': + if ("auto".equalsIgnoreCase(value)) { + this.setXAlgorithm(new AutoAxisAlgorithm()); + } else { + try { + this.setXAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value))); + } catch (NumberFormatException e) { + throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token); + } + } + break; + case 'y': + if ("auto".equalsIgnoreCase(value)) { + this.setYAlgorithm(new AutoAxisAlgorithm()); + } else { + try { + this.setYAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value))); + } catch (NumberFormatException e) { + throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token); + } + } + break; + case 'w': + if ("auto".equalsIgnoreCase(value)) { + this.setWidthAlgorithm(new AutoAxisAlgorithm()); + } else { + try { + this.setWidthAlgorithm(new AbsoluteAxisAlgorithm(Float.parseFloat(value))); + } catch (NumberFormatException e) { + throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token); + } + } + break; + case 'p': + if ("auto".equalsIgnoreCase(value)) { + this.setPageAlgorithm(new AutoPageAlgorithm()); + } else if ("new".equalsIgnoreCase(value)) { + this.setPageAlgorithm(new NewPageAlgorithm()); + } else { + try { + this.setPageAlgorithm(new AbsolutePageAlgorithm(Integer.parseInt(value))); + } catch (NumberFormatException e) { + throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token); + } + } + break; + case 'f': + try { + this.setFooterLine(Float.parseFloat(value)); + } catch (NumberFormatException e) { + throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token); + } + break; + default: + throw new PdfAsException(ErrorCode.INVALID_SIGNATURE_POSITION, "Invalid signature position element: " + token); + } + } + } + } + + public String getPositionString() { + StringBuilder sb = new StringBuilder(); + AxisAlgorithm xAlgo = getXAlgorithm(); + + if(xAlgo instanceof AutoAxisAlgorithm) { + sb.append("x:auto;"); + } else if(xAlgo instanceof AbsoluteAxisAlgorithm) { + sb.append("x:" + ((AbsoluteAxisAlgorithm)xAlgo).getAbsoluteValue() + ";"); + } + + AxisAlgorithm yAlgo = getXAlgorithm(); + + if(yAlgo instanceof AutoAxisAlgorithm) { + sb.append("y:auto;"); + } else if(yAlgo instanceof AbsoluteAxisAlgorithm) { + sb.append("y:" + ((AbsoluteAxisAlgorithm)yAlgo).getAbsoluteValue() + ";"); + } + + AxisAlgorithm wAlgo = getWidthAlgorithm(); + + if(wAlgo instanceof AutoAxisAlgorithm) { + sb.append("w:auto;"); + } else if(wAlgo instanceof AbsoluteAxisAlgorithm) { + sb.append("w:" + ((AbsoluteAxisAlgorithm)wAlgo).getAbsoluteValue() + ";"); + } + + PageAlgorithm pAlgo = getPageAlgorithm(); + + if(pAlgo instanceof AutoPageAlgorithm) { + sb.append("p:auto;"); + } else if(pAlgo instanceof NewPageAlgorithm) { + sb.append("p:new;"); + } + + float footerLine = getFooterLine(); + + sb.append("f:" + + footerLine); + + return sb.toString(); + } + + +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java index ea2143dd..7d550ddc 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AbsoluteAxisAlgorithm.java @@ -1,62 +1,85 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.axis;
-
-import java.io.Serializable;
-
-/**
- * An absolute positioned element.
- * @author wprinz
- */
-public class AbsoluteAxisAlgorithm extends AxisAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * The absolute positioning value on the axis.
- */
- protected float absoluteValue = 0.0f;
-
- /**
- * Constructor.
- * @param absoluteValue The absolute positioning value on the axis.
- */
- public AbsoluteAxisAlgorithm (float absoluteValue)
- {
- this.absoluteValue = absoluteValue;
- }
-
- /**
- * Returns absolute positioning value on the axis.
- * @return the absoluteValue Returns absolute positioning value on the axis.
- */
- public float getAbsoluteValue()
- {
- return this.absoluteValue;
- }
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign.pos.axis; + +import java.io.Serializable; + +/** + * An absolute positioned element. + * @author wprinz + */ +public class AbsoluteAxisAlgorithm extends AxisAlgorithm implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * The absolute positioning value on the axis. + */ + protected float absoluteValue = 0.0f; + + /** + * Constructor. + * @param absoluteValue The absolute positioning value on the axis. + */ + public AbsoluteAxisAlgorithm (float absoluteValue) + { + this.absoluteValue = absoluteValue; + } + + /** + * Returns absolute positioning value on the axis. + * @return the absoluteValue Returns absolute positioning value on the axis. + */ + public float getAbsoluteValue() + { + return this.absoluteValue; + } +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java index a9857b42..e0fa101d 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AutoAxisAlgorithm.java @@ -1,41 +1,64 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.axis;
-
-import java.io.Serializable;
-
-/**
- * Auto positioning for this element.
- *
- * @author wprinz
- */
-public class AutoAxisAlgorithm extends AxisAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-// empty
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign.pos.axis; + +import java.io.Serializable; + +/** + * Auto positioning for this element. + * + * @author wprinz + */ +public class AutoAxisAlgorithm extends AxisAlgorithm implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1L; +// empty +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java index dd1d1700..c43bca89 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/AxisAlgorithm.java @@ -1,41 +1,64 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.axis;
-
-import java.io.Serializable;
-
-/**
- * Determines how a certain position is chosen on the axis (x, y, width).
- *
- * @author wprinz
- */
-public abstract class AxisAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-// base class
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign.pos.axis; + +import java.io.Serializable; + +/** + * Determines how a certain position is chosen on the axis (x, y, width). + * + * @author wprinz + */ +public abstract class AxisAlgorithm implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1L; +// base class +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/package-info.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/package-info.java index c4f24440..8703b27d 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/package-info.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/axis/package-info.java @@ -1,3 +1,26 @@ +/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ /** * */ @@ -5,4 +28,4 @@ * @author afitzek * */ -package at.gv.egiz.pdfas.api.sign.pos.axis;
\ No newline at end of file +package at.gv.egiz.pdfas.api.sign.pos.axis; diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/package-info.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/package-info.java index 80914293..1dbd22eb 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/package-info.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/package-info.java @@ -1,3 +1,26 @@ +/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ /** * */ @@ -5,4 +28,4 @@ * @author afitzek * */ -package at.gv.egiz.pdfas.api.sign.pos;
\ No newline at end of file +package at.gv.egiz.pdfas.api.sign.pos; diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java index 434c20c4..ed17954f 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AbsolutePageAlgorithm.java @@ -1,64 +1,87 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.page;
-
-import java.io.Serializable;
-
-/**
- * The page is selected absolutely by giving the page number directly.
- *
- * @author wprinz
- */
-public class AbsolutePageAlgorithm extends PageAlgorithm implements Serializable
-{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * The page.
- */
- protected int page = -1;
-
- /**
- * Constructor.
- *
- * @param page
- * The page.
- */
- public AbsolutePageAlgorithm(int page)
- {
- this.page = page;
- }
-
- /**
- * @return the page
- */
- public int getPage()
- {
- return this.page;
- }
-
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign.pos.page; + +import java.io.Serializable; + +/** + * The page is selected absolutely by giving the page number directly. + * + * @author wprinz + */ +public class AbsolutePageAlgorithm extends PageAlgorithm implements Serializable +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * The page. + */ + protected int page = -1; + + /** + * Constructor. + * + * @param page + * The page. + */ + public AbsolutePageAlgorithm(int page) + { + this.page = page; + } + + /** + * @return the page + */ + public int getPage() + { + return this.page; + } + +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java index fffcbad0..54365613 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/AutoPageAlgorithm.java @@ -1,47 +1,70 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.page;
-
-import java.io.Serializable;
-
-/**
- * The page for placing the signature is selected automatically.
- *
- * <p>
- * The algorithm first tries to place the signature on the free space of the
- * last page (considering the footer). If there is not enough space on the last
- * page, a new page is appended and the signature is placed there.
- * </p>
- *
- * @author wprinz
- */
-public class AutoPageAlgorithm extends PageAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-// empty
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign.pos.page; + +import java.io.Serializable; + +/** + * The page for placing the signature is selected automatically. + * + * <p> + * The algorithm first tries to place the signature on the free space of the + * last page (considering the footer). If there is not enough space on the last + * page, a new page is appended and the signature is placed there. + * </p> + * + * @author wprinz + */ +public class AutoPageAlgorithm extends PageAlgorithm implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1L; +// empty +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java index ded9f618..e3f4b9cc 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/NewPageAlgorithm.java @@ -1,41 +1,64 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.page;
-
-import java.io.Serializable;
-
-/**
- * Places the signature on a new Page.
- *
- * @author wprinz
- */
-public class NewPageAlgorithm extends PageAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- // empty block
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign.pos.page; + +import java.io.Serializable; + +/** + * Places the signature on a new Page. + * + * @author wprinz + */ +public class NewPageAlgorithm extends PageAlgorithm implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + // empty block +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java index 16aa72ca..64840d90 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/PageAlgorithm.java @@ -1,41 +1,64 @@ -/**
- * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright>
- * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a
- * joint initiative of the Federal Chancellery Austria and Graz University of
- * Technology.
- *
- * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
- * the European Commission - subsequent versions of the EUPL (the "Licence");
- * You may not use this work except in compliance with the Licence.
- * You may obtain a copy of the Licence at:
- * http://www.osor.eu/eupl/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the Licence is distributed on an "AS IS" basis,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the Licence for the specific language governing permissions and
- * limitations under the Licence.
- *
- * This product combines work with different licenses. See the "NOTICE" text
- * file for details on the various modules and licenses.
- * The "NOTICE" text file is part of the distribution. Any derivative works
- * that you distribute must include a readable copy of the "NOTICE" text file.
- */
-package at.gv.egiz.pdfas.api.sign.pos.page;
-
-import java.io.Serializable;
-
-/**
- * Determines how the page on which the signature is to be placed is selected.
- *
- * @author wprinz
- */
-public abstract class PageAlgorithm implements Serializable
-{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- // empty
-}
+/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/** + * <copyright> Copyright 2006 by Know-Center, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.pdfas.api.sign.pos.page; + +import java.io.Serializable; + +/** + * Determines how the page on which the signature is to be placed is selected. + * + * @author wprinz + */ +public abstract class PageAlgorithm implements Serializable +{ + + /** + * + */ + private static final long serialVersionUID = 1L; + // empty +} diff --git a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/package-info.java b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/package-info.java index fec6dbea..9ac906ec 100644 --- a/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/package-info.java +++ b/pdf-as-legacy/src/main/java/at/gv/egiz/pdfas/api/sign/pos/page/package-info.java @@ -1,3 +1,26 @@ +/******************************************************************************* + * <copyright> Copyright 2014 by E-Government Innovation Center EGIZ, Graz, Austria </copyright> + * PDF-AS has been contracted by the E-Government Innovation Center EGIZ, a + * joint initiative of the Federal Chancellery Austria and Graz University of + * Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ /** * */ @@ -5,4 +28,4 @@ * @author afitzek * */ -package at.gv.egiz.pdfas.api.sign.pos.page;
\ No newline at end of file +package at.gv.egiz.pdfas.api.sign.pos.page; |