1. A method comprising: receiving an electronic document that includes hypertext markup language (HTML) code and a first raster graphics (RG) image having text-based content; converting the first RG image to a vector graphics (VG) image; determining a body size of a reference character that is located in the VG image; determining a baseline of the VG image relative to the text-based content; segmenting the VG image at one or more break points to create VG image segments; storing each of the VG image segments as separate but related VG image portions; identifying a second RG image included in the electronic document; determining that the second RG image is free from inclusion of text-based content; preserving the second RG image by refraining from converting the second RG image to a second VG image; and transmitting the electronic document comprising the VG image, the second RG image, and the HTML code to a viewing device for display, wherein the body size and the baseline enable the viewing device to resize and position the text-based content in the VG image to align with adjacent HTML text in the electronic document, and wherein the VG image portions enable the viewing device to reflow at least a portion of the text-based content.