Magento – The Order State “complete” must not be set manually.

If you want to update order status & state programmaticaly, you try this

$order->setStatus(Mage_Sales_Model_Order::STATE_COMPLETE);
$order->setState(Mage_Sales_Model_Order::STATE_COMPLETE);

And you get this error :

The Order state 'complete' must not be set manually.

To fix it, use this :

$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE, "Comments");
$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);

FPDF error: This document (docuement.pdf) probably uses a compression technique which is not supported by the free parser shipped with FPDI.

If you ever encounter this error “FPDF error: This document (docuement.pdf) probably uses a compression technique which is not supported by the free parser shipped with FPDI.”, this is a version problem, FPDF library supports only PDF version 1.4 and previous.

So, what can you do ? change PDF version with ghostscript.

Download it here http://www.ghostscript.com/download/gsdnld.html

run to change :

 ./gs-919-linux_x86_64 -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=file.pdf newfile.pdf