XPDFViewer_Image

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
XPDFViewer_Image <viewerName>, <pageNumber>, <variableName>
Associationsxpdf
Summary

This command sets the value of a named variable to the imageData of the rendered page.

EditionBusiness
Introduced1.0.0
OSmac, windows
Platformsdesktop
Parameters
NameTypeDescription
viewerName

The name of the viewer.

pageNumber

The pageNumber to return the image of.

variableName

The name of the variable to set to the image data of the page.

Example
local tImageData
XPDFViewer_Image "Document1", 1, "tImageData"
put the result into tSize
set the width of image "page" to item 1 of tSize
set the height of image "page" to item 2 of tSize
set the imageData of image "page" to tImageData
Values
NameTypeDescription
return

The image width, height in pixels.

Description

This command sets the value of a named variable to the imageData of the rendered page. The page is rendered at the current viewer scale. LiveCode imageData does not contain any width or height information so you must set the width and height of the image correctly before setting the imageData. The command returns the size (width, height) of the image. As the image is drawn at the current scale of the PDF view the width/height returned will not match the width/height calculated from XPDFViewer_Get("Document1","width") and XPDFViewer_Get("Document1","height") on Mac retina and high DPI windows systems.

The following errors may be thrown by the command:

  • XPDF_ERROR: incorrect number of parameters
  • XPDF_ERROR: PDF viewer not found
Tagsexternals