In my experience such behavior I saw when we had so many writes to the disk, and write daemon queue only grown up.

In first I would launch mgstat tool from InterSystems. But it should be started before the freezing system, and for quite long time, with at least 5 seconds interval, better if it would be 1 second. Then you should look at some columns such as WDphase, PhyWrs, WDQsz.

What you should look for. 

  • WDphase -  should not be all the time in the 8th phase.
  • WDQsz - from time to time should fall to zero
  • PhyWrs - may help to calculate a "real" speed of writing to the disk. And compare with expected speed.
  • WDPass - time to time should be increased, if WD still at the same cycle so long time, it may cause a freezing system.

Counts only lines which appear in the final "INT" code.  If you working with MAC code, you may open INT by pressing Ctrl+Shift+V in the Studio. And then you can go to this needed line wit dialog called by Ctrl+Shift+G, Where you should put 'label+line' or just '+line'. If you Studio says, that no other sources, you should check flag "Keep Generated Source Code" and add compiler flag "k" in the Studio options and recompile your routine.

Well, there are some different reasons to do it:

  • optimization network traffic for readers. You should remember, that you wrote the public article for people all around the world, with different quality of their network connection. Some people may even disable images for loading.
  • in slow internet connection, you may see empty spaces for your images, while it will be loaded.
  • it is a bit difficult to recognize your terminal images due to the white background, the same as for page. If you put it as a formatted text, it will have the different background.
w #,*27,"[32m" s $lb(tw,th,twi,c,tp,l)=$lb(2,4,8,40,4,24) while (l-th>tp) { f st=0:1:th-1 { s y=tp+st,x=c-(tw/2),w=tw-1 s:w ts(y)=$lb(x,w) w *27,"[",y,";",c-(tw/2),"H/",*27,"[",y,";",c+(tw/2),"H\" s tw=twi/th*2+tw } s tp=tp+th,tw=tw-twi } w !,*27,"[0m","Press any key to exit" f { w *27,"[",y,";",x+1,"H",$j("",w) f i=1:1:y\4 { w *27,"[",$r(10)+30,"m",*27,"[",y,";",$r(w)+x+1,"Ho",*27,"[1;1H"} s y=$o(ts(y),-1,d),$lb(x,w)=d i w<5 {s y=$o(ts(""),-1) h 0.3} r q:0 q:$t } w *27,"[0m"

Before doing such task, you should know a bit more about technologies which you going to use.
PDF - it is a binary format, so, you can't just copy text from PDF. Some of the files may contain a text, some just a picture with text.
And to get plain text from PDF, you have to use some third party OCR software. One of the leaders is ABBYY FineReader it is proprietary, but if you need you can find some products for free.