The dialog in this PDF document has the word はかります but when I search the word in romaji, only 測ります (and some other variations), show up in the results. Why is it that the kanji word 測 is written like はか for that particular example?
There is no requirement to write words in kanji. A sentence written entirely in hiragana would still be valid (if somewhat hideous to read).
Your PDF is clearly beginner level learning material. I would guess that the writers of the material decided that the kanji for 測る was too advanced to learn at that level. According to this site this kanji isn't learnt by school children until grade 5.
Notice also that "imasu" was not written "居ます" and "sumimasen" was not written "済みません"
Many words have kanji, but that doesn't mean the kanji needs to be always used. In this case, the reason is likely because the sentence comes from the PDF file that you gave us, which is for English-speaking people that are trying to learn Japanese, so the use of kanji is intentionally restricted.
I'm a native Japanese speaker. There's no right or wrong in choosing between hiragana and kanji really. But there are general guidelines, and the correct choice can lead to clearer sentences and dramatic effects.
Many words in Japanese actually have a way of writing using kanji that's not used that much in everyday usage.
Many greetings are like this:
ありがとうございます = 有難う御座います
こんにちは = 今日は
さようなら = 左様なら
Many frequently used words also tend to have kanji:
いる／います = 居る／居ます (as Nike already mentioned before me)
このこと(this thing) = 此の事
そういうとき(that sort of time) = そう云う時
These used to be the standard way of writing the words, but over time, it became obsolete probably because it's too much work.
Today, in advanced Japanese writing classes, we are usually told to avoid these kinds of usage of kanji. Since the keyboard easily suggests these kanjis when typing Japanese, some students (including myself in the past) tend to carelessly write something like "そこに居ると言う事を..." when that actually looks uneducated. In professional writing, the appropriate rate of Kanji use is said to be around 30% of the sentence. This makes the sentence most easy to read, and the meaning could be most effectively conveyed. When this is done, the hiraganas play the role of "glue" between the kanji words jumping into your eye right ahead.
今日書類提出を御願い致しましたが返答が御座居ませんでした (hard to read)
今日、書類の提出をお願いしましたが返答がありませんでした (easier, and note that the sentence already makes some sense even if you only read the kanjis)
きょう、しょるいのていしゅつをおねがいしましたがへんとうがありませんでした (hard to read)
So, just because there's a kanji-way of writing a word, using that is not always the best way. It depends on the context.
Also, in your case, there are actually multiple ways of writing はかる depending on the details of what you are measuring. 測る, 計る, 量る, could all be read はかる, and that's not even all. And some people say that they all have slightly different nuances! (I do agree to that, but can't really explain the difference in words...) While I would suggest using the first one when it's not clear what's best, simply using hiragana is always an alternative choice. I can imagine that the Japanese text you posted definitely wanted to avoid those complications, and simply took the easiest path. Nothing wrong there.
Using hiragana when there are actually kanjis is also common when you want to make some dramatic effect. I can't come up with a good example right away, but if you read mangas, I'm pretty sure you'll encounter a scene where the words are written in hiragana even when there's an easy kanji.
The main character in a dystopian Sci-Fi declares that he is going to LIVE (after a disaster or whatever). Instead of 生きる, he says いきる。 in a big cut. Sometimes that looks nicer. A bit similar to using italic or bold fonts. In Japanese you also have the choice of using a different kanji, like 活きる (though in this case, this will mean something different and doesn't really work), or using katakana イキル... (he's a robot? or maybe dying..?)