You need to edit just below three line in AbstractPdf.php
Replace line 391
$page->drawRectangle(25, $top, 570, $top - 70);
Instead of
$page->drawRectangle(25, $top, 570, $top - 55);
Replace line 397
$page->drawText(__('Order # ') . $order->getRealOrderId(), 35, $top -= 45, 'UTF-8');
instead of
$page->drawText(__('Order # ') . $order->getRealOrderId(), 35, $top -= 30, 'UTF-8');
Additional add after line no 621
$page->drawText('My Sample Text', 35, $docHeader[1] - 30, 'UTF-8');
You can print invoice your Magento order from admin by follow below steps
Admin >> Sales >> Order >> Open Order >> Click Invoice >> Submit Invoice
Now you can see your order invoice in "Invoices" tab just under "ORDER VIEW".
Click on "View" link, you can see you print button for invoice print.
Best Answer
we need to extend
Invoice.php
file.We can't override
AbstractPdf.php
directly.I have created one module for this. You can download from here.Its working properly.