On Mon 10 Dec 2012 15:59:55 +0400 Anton Shepelev wrote : > Did they publish a document explicitly stating the required margins, or > do they just tell you to use a style from a provided .doc or .docx? In > the latter case, why can't you just open that document in MS Word > and look in Page Setup, where the margins are specified? > > Another (although dirty) way would be to measure a printed document > with a ruler :-)
Hmm... Maybe my explanations were not clear, sorry. So, I reformulate. :) Our university ask us to give them our memorandum in MS Word format. This format is imposed, inter alia, to ensure respect of their instructions, including precise margins. My wish is to propose to them to use portable format only, especially pdf or postscript. Nevertheless, I think this will not be possible if they cannot verify their order as easily as with MS Word. So, my question is : is it possible to get the margins of a PDF or Postscript file simply (obviously, the answer is no) ? Of course, they can print all documents and then use a ruler, but I think they will not be convinced by this proposition. :p On Sun 09 Dec 2012 20:01:27 -0000 Ted Harding wrote : > If you convert the PDF into PS, then it is possible to parse the PS (in > principle it is in plain text) so as to locate the vertical position of > the first line of text on a page (which will be its "baseline"), and that > of the next line of text. The difference between these will be the line > spacing. All measurements are in points (possibly fractional). > > Then you can locate the baseline of the bottom line of text. > > The vertical position of the top line of text from the top of the page, > minus the line spacing, should be the top margin according to your > description. > > For the bottom, you will however need to also take into account the > length of "descenders" (i.e. the dangly bits of letters like "g", "p", > "q" and "y"). The "baseline" is where the bottoms lof letters like "z", > "m2 etc. lie. I don't know how to obtain this from a file produced by MS > Word! > > Nevertheless, this may help to get started. However, the parsing may turn > out to be complicated (especially with a file from MS Word ... ), since > there will be a lot of preliminary definitions of procedures, and you > would need to find the one which generates a move to a vertical position > to start a line. As I feared, this will be complicated. So, I have to look more deeply into the postscript format and/or found a library that help me to do the job. Thanks for your help. ;)