Documentation
» Introduction
» Converting Documents
» Large Documents
» Parameters
» Publishing with PHP
» API
» Forum

Publishing Large Documents

Making large documents available to your end users can sometimes be difficult leading to long waiting times and excessive memory consumption when trying to load the entire document at once. FlexPaper solves this by allowing you to split up your documents and downloading only the visible pages.


Publishing documents in split up mode is easy. FlexPaper 1.4.5 and onwards even provides you with out of the box examples of how to do this using PHP. Give it a try by running the 'split_document.php' file in the php directory.


The process explained

In case you cannot run PHP on your server, splitting a document up using PDF2SWF is as simple as modifying your conversion command slightly:

C:\SWFTools\pdf2swf.exe Paper.pdf -o Paper%.swf -f -T 9 -t -s storeallcharacters

The % sign is what makes PDF2SWF create one file per page. Running this command should give you files "Paper1.swf", "Paper2.swf". FlexPaper recognizes loading up pages in split mode by the having SwfFile in the following syntax: {filename[*,padding],total pages}

Following our previous example, we can now modify SwfFile parameter slightly to fit our needs:
	var fp = new FlexPaperViewer(	
	'FlexPaperViewer',
	'viewerPlaceHolder', { config : {
		  SwfFile : "{Paper[*,0].swf,28}",
		  Scale : 0.6,
		  ZoomTime : 0.5,
		  ZoomInterval : 0.1,
		  FitPageOnLoad : false,
		  FitWidthOnLoad : false,
		  PrintEnabled : false,
		  MinZoomSize : 0.2,
		  MaxZoomSize : 5,
		  localeChain : "en_US"
	}});

In this example, we are instructing FlexPaper to load up pages in a split-up approach with a total of 28 pages, with 0 in padding. The padding needs to be set to 1 should you have your files stored as "Paper01.swf", "Paper02.swf", ..