Skip to main content
Solved

Calculating automatic of scale in PDF

  • August 2, 2016
  • 2 replies
  • 167 views

danilo_fme
Celebrity
Forum|alt.badge.img+52

Hello Team,

I would like to generate a PDF file and through the transformer PDFPageFormatter i setted the the Page Object:

I would like to know if is possible the FME read my Source Data Polygon ( in meters ) and insert inside the above settings ( BoundingBox ) and calculate the scale automatic showing like a attribute.

I saw the link https://knowledge.safe.com/articles/19757/creating-pdf-cartographic-output.html but the user choose the scale when run this Workspace.

Thanks in Advance,

Best answer by redgeographics

First off, I would recommend against adding a scale factor to your map, from a cartographic point of view. The reasoning is: if you design at a scale of say 1:100000 and somebody prints it at a smaller page size and scales to fit it's not 1:100000 anymore (that happens, even in professional print shops, I could tell you some horror stories...) If it's intended to be viewed on-screen it's even more of a gamble. So a scale bar is a better solution.

Having said that...

If the width/height of your source data polygon are known you can use a BoundingBoxAccumulator and BoundsExtractor to get the extents of your data, then calculate the scale in x and y direction (xmax-xmin)/width and (ymax-ymin)/height, making sure they're all in the same units. The larger of those two scale values is the one that your data has in the PDF.

However, it's slightly off... In sample I'm using (see attached) my FME calculation ends up with a scale of 1:1322655, if I open the resulting PDF in Adobe Illustrator with the Avenza MAPublisher plug-in it shows a scale of 1:1322490. I'm not sure on which end of the process this is happening.

Probably not the answer you were looking for, but I hope it's helpful anyway. If you have any more questions let me know, I've done a fair bit of work with cartographic PDF output in FME

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

redgeographics
Celebrity
Forum|alt.badge.img+62
  • Celebrity
  • Best Answer
  • August 3, 2016

First off, I would recommend against adding a scale factor to your map, from a cartographic point of view. The reasoning is: if you design at a scale of say 1:100000 and somebody prints it at a smaller page size and scales to fit it's not 1:100000 anymore (that happens, even in professional print shops, I could tell you some horror stories...) If it's intended to be viewed on-screen it's even more of a gamble. So a scale bar is a better solution.

Having said that...

If the width/height of your source data polygon are known you can use a BoundingBoxAccumulator and BoundsExtractor to get the extents of your data, then calculate the scale in x and y direction (xmax-xmin)/width and (ymax-ymin)/height, making sure they're all in the same units. The larger of those two scale values is the one that your data has in the PDF.

However, it's slightly off... In sample I'm using (see attached) my FME calculation ends up with a scale of 1:1322655, if I open the resulting PDF in Adobe Illustrator with the Avenza MAPublisher plug-in it shows a scale of 1:1322490. I'm not sure on which end of the process this is happening.

Probably not the answer you were looking for, but I hope it's helpful anyway. If you have any more questions let me know, I've done a fair bit of work with cartographic PDF output in FME


danilo_fme
Celebrity
Forum|alt.badge.img+52
  • Author
  • Celebrity
  • August 4, 2016

First off, I would recommend against adding a scale factor to your map, from a cartographic point of view. The reasoning is: if you design at a scale of say 1:100000 and somebody prints it at a smaller page size and scales to fit it's not 1:100000 anymore (that happens, even in professional print shops, I could tell you some horror stories...) If it's intended to be viewed on-screen it's even more of a gamble. So a scale bar is a better solution.

Having said that...

If the width/height of your source data polygon are known you can use a BoundingBoxAccumulator and BoundsExtractor to get the extents of your data, then calculate the scale in x and y direction (xmax-xmin)/width and (ymax-ymin)/height, making sure they're all in the same units. The larger of those two scale values is the one that your data has in the PDF.

However, it's slightly off... In sample I'm using (see attached) my FME calculation ends up with a scale of 1:1322655, if I open the resulting PDF in Adobe Illustrator with the Avenza MAPublisher plug-in it shows a scale of 1:1322490. I'm not sure on which end of the process this is happening.

Probably not the answer you were looking for, but I hope it's helpful anyway. If you have any more questions let me know, I've done a fair bit of work with cartographic PDF output in FME

Thanks @redgeographics I understand your answer. It was helpful to me :)