Ir al contenido
Otras versiones

Cargando…

Integrate preview with other web applications

Esta página aún no está disponible en tu idioma.

You can integrate the OpenKM web preview module into other web applications quickly.

Advantages:

  • Quick integration into an iframe in your own web application.
  • All OpenKM MIME types supported by the preview modules.
  • Can be used without being logged into OpenKM.
  • Can preview documents that are not in OpenKM.

Preview parameters:

Parameter Type Description
docUrl String The full URL of a document.
We recommend using it for all file types.
swfUrl String The full URL of a .swf file.
dxfUrl String The full URL of a .dxf file.
dwfUrl String The full URL of a .dwf file.
htmUrl String The full URL of a .html file.
codUrl String The full URL of a file containing code, for example .java, .php, etc. files.
mpgUrl String The full URL of an .mp4 or .mp3 file.
pdfUrl String The full URL of a PDF document. Required by the Flexpaper previewer.
file String The full URL of a PDF document. Required by the PDF.js previewer.
PDF.js also requires the pdfUrl parameter.
previewEngine String The type of preview to be used by the server. By default it is PDF.js, but with this parameter you can force Flexpaper.
OpenKM supports Flexpaper and PDF.js as PDF previewers.

Code sample

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document Preview</title>
</head>
<body>
<div align="left">
Left panel
</div>
<div align="right">
Preview panel<br />
<iframe src="http://localhost:8080/openkm/Preview?docUrl=http://localhost/test.pdf"
style="width:800px; height:600px" frameborder="0" marginwidth="0" marginheight="0" />
</div>
</body>
</html>