Skip to content

Commit dfb0766

Browse files
Dani3lSunDani3lSun
authored andcommitted
added changelog and version for v1.5
1 parent 7c01a73 commit dfb0766

File tree

2 files changed

+65
-7
lines changed

2 files changed

+65
-7
lines changed

README.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The screenshot is based on the DOM and as such may not be 100% accurate to the r
55
**Works best in modern browsers** [For more informations visit html2canvas](https://github.com/niklasvh/html2canvas)
66

77
##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+
810
####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)
911

1012
####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:
2729
- **Selector Border Color** - Color of the DOM selector outline
2830
- **Selector Fill Content** - Whether the content of a selected area is filled with color or not. (30% darker than selector´s border color)
2931
- **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
3234
- **Background color** - Canvas background color, if none is specified in DOM. Set undefined for transparent
3335
- **Width** - Width in pixels (default screen width)
3436
- **Height** - Height in pixels (default screen height)
@@ -41,8 +43,8 @@ The plugin settings are highly customizable and you can change:
4143
- As action choose "APEX Screen Capture".
4244
- Choose best fitting plugin attributes (help included)
4345

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:
4648

4749
```language-sql
4850
CREATE OR REPLACE FUNCTION png2blob(i_clob IN CLOB) RETURN BLOB IS
@@ -60,6 +62,62 @@ BEGIN
6062
END png2blob;
6163
```
6264

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+
63121
####Excluding page areas from getting rendered
64122
If you would like to exclude some areas from getting rendered to the resulting image, just add
65123

@@ -72,7 +130,7 @@ If you would like to exclude a complete region add the "data-html2canvas-ignore"
72130

73131

74132
##Demo Application
75-
https://apex.oracle.com/pls/apex/f?p=57743:14
133+
https://apex.oracle.com/pls/apex/f?p=APEXPLUGIN
76134

77135
##Preview
78136
![](https://github.com/Dani3lSun/apex-plugin-apexscreencapture/blob/master/preview.gif)

apexplugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name" : "APEX Screen Capture",
3-
"version" : "1.4",
3+
"version" : "1.5",
44
"description" : "This plugin allows you to take screenshots/captures of pages or parts of it, directly on the users browser.",
55
"keywords" : ["screenshot", "capture", "pages", "screen"],
66
"homepage" : "https://github.com/Dani3lSun/apex-plugin-apexscreencapture",
@@ -25,7 +25,7 @@
2525
"plugin" : {
2626
"internalName" : "DE.DANIELH.APEXSCREENCAPTURE",
2727
"type" : "dynamic action",
28-
"demo" : "https://apex.oracle.com/pls/apex/f?p=57743:14",
28+
"demo" : "https://apex.oracle.com/pls/apex/f?p=APEXPLUGIN",
2929
"previewImage" : "https://raw.githubusercontent.com/Dani3lSun/apex-plugin-apexscreencapture/master/preview.gif"
3030
}
3131
}

0 commit comments

Comments
 (0)