@@ -5,6 +5,8 @@ The screenshot is based on the DOM and as such may not be 100% accurate to the r
5
5
** Works best in modern browsers** [ For more informations visit html2canvas] ( https://github.com/niklasvh/html2canvas )
6
6
7
7
##Changelog
8
+ ####1 .5 - removed the save to item functionality / instead added a AJAX function which saves the resulting image to Database using custom PL/SQL code
9
+
8
10
####1 .4 - Added options to pick a border color of your choice / fill the selector´s content with light transparent color (based on border color)
9
11
10
12
####1 .3 - Added options to choose a filter of graphical DOM selector / Hide label of graphical DOM selector
@@ -27,8 +29,8 @@ The plugin settings are highly customizable and you can change:
27
29
- ** Selector Border Color** - Color of the DOM selector outline
28
30
- ** Selector Fill Content** - Whether the content of a selected area is filled with color or not. (30% darker than selector´s border color)
29
31
- ** JQuery Selector** - Enter the JQuery Selector that should be captured
30
- - ** Open image in new tab (or save to Item )** - Choose whether the image should be opened in a new tab or saved as base64 png to an APEX item
31
- - ** Item Picker ** - Item which holds the base64 png image informations
32
+ - ** Open image in new tab (or save to DB )** - Choose whether the image should be opened in a new window or saved to DB using custom PL/SQL (for BLOBs)
33
+ - ** PLSQL Code ** - PLSQL code which saves the image to database tables or collections
32
34
- ** Background color** - Canvas background color, if none is specified in DOM. Set undefined for transparent
33
35
- ** Width** - Width in pixels (default screen width)
34
36
- ** Height** - Height in pixels (default screen height)
@@ -41,8 +43,8 @@ The plugin settings are highly customizable and you can change:
41
43
- As action choose "APEX Screen Capture".
42
44
- Choose best fitting plugin attributes (help included)
43
45
44
- ####Convert image to BLOB in PL/SQL
45
- If you choose to save the screenshot (data uri base64 png) to an APEX item you can use a PL/SQL function like this to convert it to BLOB:
46
+ ####Convert image to BLOB in PL/SQL / save to DB
47
+ If you choose to save the screenshot (data uri base64 png) to DB you can use a PL/SQL function like this to convert it to BLOB:
46
48
47
49
``` language-sql
48
50
CREATE OR REPLACE FUNCTION png2blob(i_clob IN CLOB) RETURN BLOB IS
60
62
END png2blob;
61
63
```
62
64
65
+ A sample code for the "PLSQL code" attribute of the plugin could look like this:
66
+
67
+ ``` language-sql
68
+ DECLARE
69
+ --
70
+ l_collection_name VARCHAR2(100);
71
+ l_clob CLOB;
72
+ l_clob_base64 CLOB;
73
+ l_blob BLOB;
74
+ l_filename VARCHAR2(100);
75
+ l_mime_type VARCHAR2(100);
76
+ --
77
+ BEGIN
78
+ -- get defaults
79
+ l_collection_name := 'SCREEN_CAPTURE';
80
+ l_filename := 'screenshot_' ||
81
+ to_char(SYSDATE,
82
+ 'YYYYMMDDHH24MISS') || '.png';
83
+ l_mime_type := 'image/png';
84
+ -- get CLOB from APEX special collection
85
+ SELECT clob001
86
+ INTO l_clob
87
+ FROM apex_collections
88
+ WHERE collection_name = 'CLOB_CONTENT';
89
+ --
90
+ -- escape special chars (similar to png2blob function)
91
+ l_clob_base64 := REPLACE(REPLACE(REPLACE(REPLACE(l_clob,
92
+ chr(10),
93
+ ''),
94
+ chr(13),
95
+ ''),
96
+ chr(9),
97
+ ''),
98
+ 'data:image/png;base64,',
99
+ '');
100
+ -- convert base64 CLOB to BLOB (mimetype: image/png)
101
+ l_blob := apex_web_service.clobbase642blob(p_clob => l_clob_base64);
102
+ --
103
+ -- create own collection
104
+ -- check if exist
105
+ IF NOT
106
+ apex_collection.collection_exists(p_collection_name => l_collection_name) THEN
107
+ apex_collection.create_collection(l_collection_name);
108
+ END IF;
109
+ -- add collection member (only if BLOB not null)
110
+ IF dbms_lob.getlength(lob_loc => l_blob) IS NOT NULL THEN
111
+ apex_collection.add_member(p_collection_name => l_collection_name,
112
+ p_c001 => l_filename, -- filename
113
+ p_c002 => l_mime_type, -- mime_type
114
+ p_d001 => SYSDATE, -- date created
115
+ p_blob001 => l_blob); -- BLOB img content
116
+ END IF;
117
+ --
118
+ END;
119
+ ```
120
+
63
121
####Excluding page areas from getting rendered
64
122
If you would like to exclude some areas from getting rendered to the resulting image, just add
65
123
@@ -72,7 +130,7 @@ If you would like to exclude a complete region add the "data-html2canvas-ignore"
72
130
73
131
74
132
##Demo Application
75
- https://apex.oracle.com/pls/apex/f?p=57743:14
133
+ https://apex.oracle.com/pls/apex/f?p=APEXPLUGIN
76
134
77
135
##Preview
78
136
![ ] ( https://github.com/Dani3lSun/apex-plugin-apexscreencapture/blob/master/preview.gif )
0 commit comments