Documentation menu

Appearance

The signature appearance is controlled entirely by option keys passed to Atick::signPfx($pdf, $pfx, $options). By default ATick shows its logo on the left, the signer details on the right, and the validity mark.

appearance.php
require 'vendor/autoload.php';
use Aniketc068\ATick\Atick;

$pdf = file_get_contents("doc.pdf");
$pfx = file_get_contents("my.pfx");

$signed = Atick::signPfx($pdf, $pfx, [
    "cn"         => "Axonate Tech",   // common name (shown bold after "Digitally Signed by:")
    "org"        => "Acme Corp",           // organisation line
    "reason"     => "Approved",            // "Reason: …"
    "location"   => "New Delhi",           // "Location: …"
    "green_tick" => true,
]);

file_put_contents("signed.pdf", $signed);

Long signer names wrap onto more lines instead of shrinking the font, so the box never overflows.

Date / time

date.php
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket"]);                                  // current time (default)
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "date" => "Signed on 10-Jun-2026"]); // a fixed string
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "date" => ""]);                    // no date line

The left side

The image key controls what is drawn on the left of the appearance:

image.php
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket"]);                    // default: the ATick logo
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "image" => "none"]); // no logo
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "image" => "cn"]);   // the CN as large text on the LEFT (Adobe-style)
image valueResult
omittedthe default ATick logo
"none"no logo on the left
"cn"the signer name as text on the left instead of a logo

The validity mark — ATick's signature look

The mark sits centred in the appearance and tells the reader the signature's status at a glance:

mark.php
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "green_tick" => true]);    // the "?" mark — Adobe paints it GREEN if valid+trusted, RED if invalid
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "always_check" => true]);  // ATick's green-tick graphic as the base (Adobe still reds a bad signature)
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "green_tick" => false]);   // no mark — a plain signature
  • green_tick => true — the classic validity mark: a ? that Adobe Acrobat repaints greenfor a valid, trusted signature and red for a broken one.
  • always_check => true — uses ATick's own green-tick graphic as the base, so the tick shows in every viewer; Adobe still overlays a red mark if the signature is actually invalid.
  • green_tick => false — no mark; a plain signature appearance.

How Adobe shows it

When the certificate is valid and trusted, Adobe Reader / Acrobat reports “Signed and all signatures are valid” and paints the tick green — exactly the reassurance your readers expect.

Every state Adobe can show

ATick draws the appearance and the mark; Adobe then colours the mark based on the signature's validity and whether it trusts the certificate, so your reader instantly sees the status:

  • Valid & trusted — signature intact and the certificate chains to a root Adobe trusts — "Signed and all signatures are valid."
  • Validity unknown — signature intact, but Adobe doesn't trust the certificate's root"Validity unknown."
  • Not verified — Adobe hasn't validated the signature yet (no trust information) — "Signature not verified."
  • Invalid — the document was changed after signing (or the signature is broken) — "Signature is invalid."

So the green tick appears only when the signature is valid and the signer's certificate chains to a root Adobe trusts (the Adobe Approved Trust List, or your organisation's trust). The same ATick appearance shows the question-mark or red-cross state automatically — you don't draw those; Adobe does.

Colouring the mark

Colour the mark with a hex string, a CSS colour name, or an [r, g, b] array — or fill it with an axial gradient:

color.php
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "green_tick" => true, "mark_color" => "#E53935"]);        // hex
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "green_tick" => true, "mark_color" => "blue"]);           // CSS name
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "green_tick" => true, "mark_color" => [255, 140, 0]]);    // RGB array
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "green_tick" => true, "mark_gradient" => ["red", "orange", "yellow"]]);  // gradient

Use mark_scale to resize the mark relative to the appearance box.

Distinguished name

dn.php
Atick::signPfx($pdf, $pfx, [
    "cn" => "Axonate Tech",
    "dn" => "CN=Axonate Tech, O=Personal, C=IN",
]);

The DN is shown directly under the "Digitally Signed by:" line.

Custom-text-only appearance

Show only your own text — no "Signed by", no date, no CN structure. Inside body, \n starts a new line and *word* makes that run bold:

body.php
Atick::signPfx($pdf, $pfx, [
    "body" => "*APPROVED*\nReviewed by: *Axonate Tech*\nThis document is *legally binding*.",
]);
In a PHP double-quoted string, \n is a real newline character — use double quotes for body(single-quoted strings leave \n literal). ATick reads each newline as a line break.

Positioning the appearance

Place the appearance with page + rect, or stamp several positions at once with placements. Coordinates are PDF points as [x1, y1, x2, y2].

position.php
Atick::signPfx($pdf, $pfx, [
    "cn" => "Aniket", "green_tick" => true, "page" => 1, "rect" => [300, 55, 575, 175],
]);

// one stamp per entry: [page, [x1,y1,x2,y2]]
Atick::signPfx($pdf, $pfx, [
    "cn" => "Aniket", "green_tick" => true,
    "placements" => [[1, [300, 55, 575, 175]], [2, [300, 55, 575, 175]]],
]);

You can also size the box directly with width and height.

Fine-tuning the layout

Once the box is placed you can nudge the mark, the logo region, and the text independently — useful for matching an exact house style without recomputing the rectangle.

tune.php
Atick::signPfx($pdf, $pfx, [
    "cn"          => "Aniket",
    "green_tick"  => true,
    "top_reserve" => 0.32,        // fraction of the box height reserved at the top for the logo / mark
    "mark_scale"  => 1.15,        // scale the mark up (1.0 = default)
    "mark_dx"     => 4,           // nudge the mark right (PDF points; negative = left)
    "mark_dy"     => -2,          // nudge the mark down (negative = up)
    "text_dx"     => 6,           // nudge the signer text horizontally
    "text_top"    => 0.5,         // vertical start of the text block (fraction of box height)
]);
KeyTypeMeaning
top_reservenumber (0–1)Fraction of the box height reserved at the top for the logo / validity mark.
mark_scalenumberScale factor for the mark (1.0 = default).
mark_dxnumberNudge the mark horizontally in PDF points (negative = left).
mark_dynumberNudge the mark vertically in PDF points (negative = up).
text_dxnumberNudge the signer text horizontally in PDF points.
text_topnumberVertical start of the text block (fraction of the box height).

Border colour & width

With border => true you can set the border's colour and thickness:

border.php
Atick::signPfx($pdf, $pfx, [
    "cn"           => "Aniket",
    "border"       => true,
    "border_color" => [0, 102, 204],   // [r, g, b] (0–255)
    "border_width" => 1.0,             // line width in PDF points
]);
KeyTypeMeaning
borderboolDraw a border around the appearance box.
border_color[r, g, b]Border colour (each channel 0–255). Requires border => true.
border_widthnumberBorder line width in PDF points (default 1.0).

Invisible signature

A cryptographically valid signature that draws nothing on the page — pass an empty placementsarray:

invisible.php
Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "placements" => []]);   // empty placements

Other appearance options

KeyPurpose
headingthe heading line at the top of the appearance
textextra free text line
ouorganisational-unit line
font_sizesize of the appearance text
text_colorcolour of the text
bg_colorbackground fill of the box
borderdraw a border around the box
border_color, border_widthborder colour [r,g,b] and line width (with border => true)
width, heightthe box size
top_reservefraction of box height reserved at the top for the logo / mark
mark_scalescale factor for the validity mark
mark_dx, mark_dynudge the mark horizontally / vertically (PDF points)
text_dx, text_topnudge the signer text horizontally / set its vertical start

Errors

Every failure throws an Aniketc068\ATick\AtickException:

errors.php
try {
    Atick::signPfx($pdf, $pfx, ["cn" => "Aniket", "image" => "missing.png"]);
} catch (\Aniketc068\ATick\AtickException $e) {
    echo "signing failed: " . $e->getMessage();
}

Next page →