Last weekend I filled PIT
(Personal Income Tax) declaration for the previous year.
Since 2010 I sent it over the network (e-PIT
), but before that, I used to visit a tax office to stamp document. Year by year,
the whole procedure seems to be simpler, and it’s a good direction.
I accustomed to use dedicated programs for PIT
. For years I tested two that support Linux
. Each time, I install such a program on VirtualBox
,
with all strange stuff required to call it on Linux
. Also, I stopped printing a filled document.
I store it in PDF
(Portable Document Format) – I’m sure that you know this format.
Why do you write about it? – you may ask. There is a small problem with a document when I open it on another machine. It looks like this:
Please wait...
If this message is not eventually replaced by the proper contents of the document, your PDF
viewer may not be able to display this type of document.
You can upgrade to the latest version of Adobe Reader for Windows®, Mac, or Linux® by
visiting http://www.adobe.com/products/acrobat/readstep2.html.
For more assistance with Adobe Reader visit http://www.adobe.com/support/products/
acrreader.html.
Had you seen that before? Yep, PDF
is non-portable – to me more specific – PDF
made by Adobe Reader
doesn’t follow ISO standard.
There are plenty of PDF
Linux viewers, but only Adobe Reader
can open self made documents. I know – it supports forms,
editing, but I don’t care. I want to make a backup of my PIT
and open it on any machine.
How to deal with it? If you have access to a machine that has Adobe Reader
you can generate a truly portable file. Here is a simple trick.
First, I use option print and chose Print to file with marked print as image. It generates a PostScript
file.
It’s portable and most of PDF
readers also support this format. Second, if you need PDF
, you may transform it into that
format with another small trick. An ordinary attempt doesn’t work:
dirdival@discworld:/tmp$ ps2pdf old.ps
This PostScript file was created from an encrypted PDF file.
Redistilling encrypted PDF is not permitted.
Error: /undefined in --eexec--
Operand stack:
--nostringval-- --dict:86/200(L)-- quit
Execution stack:
%interp_exit .runexec2 --nostringval-- eexec --nostringval-- 2 %stopped_push --nostringval-- eexec eexec false 1 %stopped_push 1992 1 3 %oparray_pop 1991 1 3 %oparray_pop 1979 1 3 %oparray_pop 1833 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- eexec --nostringval-- 2 %stopped_push --nostringval-- 1825 2 3 %oparray_pop eexec --nostringval-- eexec
Dictionary stack:
--dict:724/1123(ro)(G)-- --dict:1/20(G)-- --dict:86/200(L)-- --dict:724/1123(ro)(G)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.27: Unrecoverable error, exit code 1
Ghostscript
doesn’t recognise eexec
. Here is the trick:
sed '/^%% Removing the following eleven lines is illegal.*/,+11 s|^|%% |' old.ps > new.ps
and the difference between files:
dirdival@discworld:/tmp$ diff old.ps new.ps
7935,7946c7935,7946
< %% Removing the following eleven lines is illegal, subject to the Digital Copyright Act of 1998.
< mark currentfile eexec
< 54dc5232e897cbaaa7584b7da7c23a6c59e7451851159cdbf40334cc2600
< 30036a856fabb196b3ddab71514d79106c969797b119ae4379c5ac9b7318
< 33471fc81a8e4b87bac59f7003cddaebea2a741c4e80818b4b136660994b
< 18a85d6b60e3c6b57cc0815fe834bc82704ac2caf0b6e228ce1b2218c8c7
< 67e87aef6db14cd38dda844c855b4e9c46d510cab8fdaa521d67cbb83ee1
< af966cc79653b9aca2a5f91f908bbd3f06ecc0c940097ec77e210e6184dc
< 2f5777aacfc6907d43f1edb490a2a89c9af5b90ff126c0c3c5da9ae99f59
< d47040be1c0336205bf3c6169b1b01cd78f922ec384cd0fcab955c0c20de
< 000000000000000000000000000000000000000000000000000000000000
< cleartomark
---
> %% %% Removing the following eleven lines is illegal, subject to the Digital Copyright Act of 1998.
> %% mark currentfile eexec
> %% 54dc5232e897cbaaa7584b7da7c23a6c59e7451851159cdbf40334cc2600
> %% 30036a856fabb196b3ddab71514d79106c969797b119ae4379c5ac9b7318
> %% 33471fc81a8e4b87bac59f7003cddaebea2a741c4e80818b4b136660994b
> %% 18a85d6b60e3c6b57cc0815fe834bc82704ac2caf0b6e228ce1b2218c8c7
> %% 67e87aef6db14cd38dda844c855b4e9c46d510cab8fdaa521d67cbb83ee1
> %% af966cc79653b9aca2a5f91f908bbd3f06ecc0c940097ec77e210e6184dc
> %% 2f5777aacfc6907d43f1edb490a2a89c9af5b90ff126c0c3c5da9ae99f59
> %% d47040be1c0336205bf3c6169b1b01cd78f922ec384cd0fcab955c0c20de
> %% 000000000000000000000000000000000000000000000000000000000000
> %% cleartomark
How you can see, to not have problems with the law, we preserve all lines even with an extra comment on the beginning.
After that, ps2pdf
just works:
dirdival@discworld:/tmp$ ps2pdf new.ps
dirdival@discworld:/tmp$ ls new.pdf
new.pdf
I hope you enjoyed this little trick.
BTW, did you know that by default e-pity
, one of the most used programs in Poland to fill PIT
declaration, sends your data to Google Analytics
? How do you feel about it? Is it fine?