Select to view content in your preferred language

FSV 1.3: My version of PDF Widget using AlivePDF

4569
21
09-01-2010 09:32 AM
BrianOevermann
Frequent Contributor
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.

Brian
0 Kudos
21 Replies
by Anonymous User
Not applicable
Original User: lallen4585

Brian,

I loaded your PDF widget into my SFV 1.3 site and get some errors on compile.  I am using Flashbuilder 4, SDK 3.5.
Looks like I need to add classes?? See attached image. Any ideas?

[ATTACH=CONFIG]2476[/ATTACH]
0 Kudos
BrianOevermann
Frequent Contributor
Lee,

Just scanning the list of errors in the image you attached, those all appear to be associated with the AlivePDF library.  Have you downloaded AlivePDF 0.1.5 RC and referenced that library in your project?  I suspect that you haven't and that will solve this issue.

I am still running Flex Builder 3, so it is entirely possible that there is an issue associated with bringing the widget into Flash Builder 4, but to me that seems unlikely in this case, though I have no way to test that scenario.

I apologize to everyone regarding not mentioning downloading the AlivePDF library first.  I guess I wrongly assumed folks would understand that mentioning that the widget uses that library implied that you would need that library installed/referenced to successfully compile the widget.

Lee, let me know if this solved your issue.

Brian
0 Kudos
by Anonymous User
Not applicable
Original User: lallen4585

Yep, still learning.  Don't forget about us newbies.  It works great, just got to make some adjustments to the output!
0 Kudos
BrianOevermann
Frequent Contributor
Lee,
I would classify myself as still in the 'newbie' section for Flex as well.  Glad that you got the widget working.

FYI for you and anyone else using my widget, I was showing a user the new widget yesterday and he happens to have a system with a monitor resolution of 1024 x 768 (I am running at 1600x1200).  The portrait template worked reasonably well, though the map was clipped on the right-hand side of the page.  The landscape template had the map overflowing into the title block.  The takeaway for me was that I need to explore the results of the pdf formatting at different monitor resolution a bit more.

I may need to revisit the discussions from folks using a canvas element instead of consuming the map directly...

Brian
0 Kudos
by Anonymous User
Not applicable
Original User: lallen4585

I just noticed that, the image is getting compressed horizontally.  I thought I would adjust a bit.  Please reply back on this thread if you get the canvas element working so that there is not distortion because of the screen monitor size.  I am going to look into that as well.  Thanks for your help.
0 Kudos
KomanDiabate
Deactivated User
I tried downloading the zip file, I think it's corrupted. Do you mind posting the zip file again.
Thanks a bunch.
0 Kudos
by Anonymous User
Not applicable
Original User: dpaddock

This forum has an issue with corrupting ZIP files when downloaded using IE. Can you try another browser?
0 Kudos
KomanDiabate
Deactivated User
Thanks Dasa, that was really helpful. I was able to download using Mozilla Firefox.

Koman Diabate
0 Kudos
by Anonymous User
Not applicable
Original User: kdiabate64

Hello All,
1 - I just noticed that on the portrait layout, the map covers only half of the page. Doesn't anybody know how fix this issue on the layout? - See attachment.

Thanks.
0 Kudos