XPDFViewer_GetSelectionImage

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

This command sets the value of a named variable to the imageData of the current image selection.

EditionBusiness
Introduced1.0.0
OSmac, windows
Platformsdesktop
Parameters
NameTypeDescription
viewerName

The name of the viewer.

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

The image width, height in pixels.

Description

The selection 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_GetImageSelectionRect 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