Customizing the Flash WebViewer

147 views
Skip to first unread message

Support

unread,
Mar 26, 2013, 12:57:03 PM3/26/13
to pdfnet-w...@googlegroups.com
Q:
 
I downlaoded the WebViewer demo samples, and I think they are great match our requirements.
 
I need to customize the tool bar panel of the webviewer.
 
I customized the html5 webviewer according to some posts (e.g. https://groups.google.com/d/msg/pdfnet-webviewer/UTyXqbKkbfc/tZInzuc0bDUJ), and I am now trying to customize the Flash WebViewer.
 
I got the FlashWebViewerSDK.zip from here (http://www.pdftron.com/ID-f94ls2-edm0aqZ/FlashWebViewerSDK.zip), and dowloaded the Flashdevelop to build a custom viewer, but I got some errors. I almost know nothing about the Flash development, but the errors seem to indicate that something is missing in the zip file:
 

D:\FlashWebViewerSDK\Samples\ReaderControl\src\com\pdftron\webviewer\ThumbnailItem.as(30): col: 40 Error: Type was not found or was not a compile-time constant: DocumentViewer.
public function ThumbnailItem(viewer:DocumentViewer, page:uint, width:Number, height:Number)

 etc

 
--------------
A: 
 

First, please read carefully the README_FIRST.txt file that is included with the download.

Based on the error messages, it looks like you're not including the WebViewer.swc file (located in Samples\ReaderControl\lib folder). Your project then includes the ReaderControl.swc generated by the ReaderControl project (loacted in Samples\ReaderControl\bin folder).

If you're using FlashBuilder, then these instructions work fine for us.

 

1. Extract to FlashWebViewerSDK folder

2. Open Flash Builder

3. Switch to new workspace and set to the directory where FlashWebViewerSDK was extracted

4. Select File -> "Import Flash Builder Project..."

5. Select "Project Folder:" radio button

6. Browse to "Samples\ReaderControl"

7. Select Finish.

8. Repeat steps 4-7 but for "Samples\WebViewerDemo"

9. Copy output of "Samples\WebViewerDemo\bin-debug" to your server. For example "c:\www_root\webviewer"

10. Load webpage "http://localhost/webviewer/WebViewer.html" in your browser.

As for customization, all source code that we provide is already included. See "Samples\ReaderControl\src\com\pdftron\webviewer\ReaderControl.mxml" as your starting point. Everything you want to change is there, or can be found from there. Also the documentation folder shows the API that ReaderControl uses.

 

Support

unread,
Mar 27, 2013, 7:21:50 PM3/27/13
to pdfnet-w...@googlegroups.com
Q:
 
I  have been able to  customize the flash webviewer according to the instruction what you gave me. Thank you very much.
How can I disable the right-click context menu of flash WebViewer?

Especially the printing menu or please give me some clue.

---------------

A:
 

The flash runtime actually prevents the full disabling of the context menu. However you can get rid of almost everything in it, including print.

 

Here are some links to help you with this.

 

http://www.adrianparr.com/?p=48

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/ContextMenu.html#builtInItems

Support

unread,
Mar 27, 2013, 7:56:34 PM3/27/13
to pdfnet-w...@googlegroups.com
Q:

I tried to get the Flash Viewer going to run some simple tests. I followed the instructions from the README_FIRST.txt file. 

Attached is a zip of all files that were generated in the bin-debug. I placed them in my server and when I try to run the PDFTronFlashViewerTest.html I get a blank/empty screen.  Am I missing something here?
 
------
A:
 

Your swf is really small, 77kb, versus the WebViewerDemo swf file of 965kb, so it looks like you're missing the ReaderControl file. See the following screenshot.

 

 

 

If you're using Flash Builder, right click your project, select properties and go to the "Flex Build Path" tab.

From here you set whether the library dependencies are "Merged into code", "external" or "Runtime shared library (RSL)". I normally set them all to "Merged into code", except for the the main Flex libraries. Otherwise, using external or RSL is more complex when it comes to setup, and a 965kb file will download very fast, its probably not worth the trouble.

Reply all
Reply to author
Forward
0 new messages