Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
The function inserts an image from a file.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
FilePath | The native file path to the image file. | $path | |
PosX | The X position (from left of page) | 0 | |
PosY | The Y position (from bottom of page) | 0 | |
ScaleWidth | The scaled width of the image. | $width | |
ScaleHeight | The scaled height of the image. | $height | |
Index | The index of the image for multi image files. | 1 | Optional |
Returns image handle number or error message.
Set a few options and insert image from file:
MBS( "DynaPDF.SetCompressionFilter"; $PDF; "flate" )
MBS( "DynaPDF.SetSaveNewImageFormat"; $PDF; 0 )
MBS( "DynaPDF.SetResolution"; $PDF; 300 )
MBS( "DynaPDF.SetUseTransparency"; $PDF; 0 )
MBS( "DynaPDF.InsertImageFile"; $PDF; "C:\test.jpg"; 72; 72; 300; 200; 1 )
Insert and reduce qualty to save space:
MBS( "DynaPDF.SetJPEGQuality"; $PDF; 75 )
MBS( "DynaPDF.SetCompressionFilter"; $PDF; "jpeg" )
MBS( "DynaPDF.SetSaveNewImageFormat"; $PDF; 1 )
MBS( "DynaPDF.SetResolution"; $PDF; 100 )
MBS( "DynaPDF.SetUseTransparency"; $PDF; 0 )
MBS( "DynaPDF.InsertImageFile"; $PDF; "C:\test.jpg"; 72; 72; 300; 200; 1 )
Created 18th August 2014, last changed 1st February 2015
DynaPDF.InsertImage - DynaPDF.InsertMetafile
Feedback: Report problem or ask question.