Start of encoder for pdf