That is why you understand what you are going into, “basic editing” of PDF content is almost always non-trivial.
The content of the page in PDF is represented by short RPN programs that are drawn on the page. This is a small language similar to PostScript in semantics, but without looping structures or function definitions (so there is no problem with stopping). In a normal world, your text on a page will be presented as follows:
BT /F1 12 Tf 72 720 Td (this is a text in a pdf document) Tj ET
which when translated into something more familiar:
BeginText();
SetFont(F1, 12.0);
TextMoveTo(72, 720);
ShowText("this is a text in a pdf document");
EndText();
So, in this case, you need to convert this to something like this:
BeginText();
SetFont(F1, 12.0);
TextMoveTo(72, 720);
ShowText("this is a ");
SetFont(F2, 12);
ShowText("text");
SetFont(F1, 12);
ShowText(" in a pdf document");
EndText();
which will be as follows:
BT /F1 12 Tf 72 720 Td (this is a ) Tj /F2 12 Tf (text) Tj /F1 12 Tf
( in a pdf document) Tj ET
in equivalent pdf. The problem is multiple:
3 - , , , , , , 70% . , , . PDF ( , troff), , , . , . , , , TJ, . ( ), . , (, )? , - ?
, Acrobat 1.0, , . - .
- - xpdf, , PDF PDF. PdfLib, , -, PDF-, , , , .
, , , . Atalasoft, , , PDF (, ). , , PDF . , - ( - ), PDF . PDF-, , 8 () 9 (), , .