AnsweredAssumed Answered

FSV 1.3:  My version of PDF Widget using AlivePDF

Question asked by BrianO on Sep 1, 2010
Latest reply on Aug 20, 2012 by MagNess
Attached is my version of a PDF widget to create portrait and landscape maps in the Sample Viewer 1.3, along with an example of each page orientation. It uses AlivePDF 0.1.5 RC and is written targeting Flash Player 10. No server-side components are required. The widget does not use a canvas element but consumes the map image directly.

The widget was based from the default print widget in the sample viewer and buttressed with a number of tips gleaned from the numerous AlivePDF discussions on these forums.

The result is not perfect, particularly the scaling of the map image into the pdf template. But that appears to be a shortcoming of the API/libraries in general. If anyone has come up with a method (preferably using the map image directly) to scale the map image to a defined "box" and still preserve aspect ratio, I would be grateful to see it!

I still need to refine my templates (and add a 'real', better quality logo) but I will wait until I get feedback from my users. For those that will inevitably ask for a pre-compiled .swf I will say that you really need to compile this yourself due to the tweaks needed for the template format. I tried to put most of the common elements into the config file, but your logo and disclaimer text will likely cause you to move some page elements around for best fit. My previous forum question regarding peoples' methods of creating AlivePDF templates generated zero response, so I can only assume that the trial-and-error method of positioning elements on the page is what everyone else is using. That took the bulk of the time creating this widget.

FYI, the two pdf examples were generated with the map jpg quality at 75%. The attached code has the quality set at 100%. For some reason the attachment uploader though my pdf files were over the 2 mb size limit even though they were only slightly over 1 mb. In comparing the two quality settings, I see little to no loss of quality but a huge file size difference. Something to think about...

I have no idea how well this will transfer to 2.0. I haven't had a chance to upgrade to ArcGIS 10 yet.

Enjoy, and I hope folks find this useful either in its entirety or for a jump-start. Hopefully this is just the start of my giving back to the community.