Skip to content

Commit

Permalink
added changelog and version for v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Dani3lSun authored and Dani3lSun committed Jan 5, 2016
1 parent 7c01a73 commit dfb0766
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 7 deletions.
68 changes: 63 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The screenshot is based on the DOM and as such may not be 100% accurate to the r
**Works best in modern browsers** [For more informations visit html2canvas](https://github.com/niklasvh/html2canvas)

##Changelog
####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

####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)

####1.3 - Added options to choose a filter of graphical DOM selector / Hide label of graphical DOM selector
Expand All @@ -27,8 +29,8 @@ The plugin settings are highly customizable and you can change:
- **Selector Border Color** - Color of the DOM selector outline
- **Selector Fill Content** - Whether the content of a selected area is filled with color or not. (30% darker than selector´s border color)
- **JQuery Selector** - Enter the JQuery Selector that should be captured
- **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
- **Item Picker** - Item which holds the base64 png image informations
- **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)
- **PLSQL Code** - PLSQL code which saves the image to database tables or collections
- **Background color** - Canvas background color, if none is specified in DOM. Set undefined for transparent
- **Width** - Width in pixels (default screen width)
- **Height** - Height in pixels (default screen height)
Expand All @@ -41,8 +43,8 @@ The plugin settings are highly customizable and you can change:
- As action choose "APEX Screen Capture".
- Choose best fitting plugin attributes (help included)

####Convert image to BLOB in PL/SQL
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:
####Convert image to BLOB in PL/SQL / save to DB
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:

```language-sql
CREATE OR REPLACE FUNCTION png2blob(i_clob IN CLOB) RETURN BLOB IS
Expand All @@ -60,6 +62,62 @@ BEGIN
END png2blob;
```

A sample code for the "PLSQL code" attribute of the plugin could look like this:

```language-sql
DECLARE
--
l_collection_name VARCHAR2(100);
l_clob CLOB;
l_clob_base64 CLOB;
l_blob BLOB;
l_filename VARCHAR2(100);
l_mime_type VARCHAR2(100);
--
BEGIN
-- get defaults
l_collection_name := 'SCREEN_CAPTURE';
l_filename := 'screenshot_' ||
to_char(SYSDATE,
'YYYYMMDDHH24MISS') || '.png';
l_mime_type := 'image/png';
-- get CLOB from APEX special collection
SELECT clob001
INTO l_clob
FROM apex_collections
WHERE collection_name = 'CLOB_CONTENT';
--
-- escape special chars (similar to png2blob function)
l_clob_base64 := REPLACE(REPLACE(REPLACE(REPLACE(l_clob,
chr(10),
''),
chr(13),
''),
chr(9),
''),
'data:image/png;base64,',
'');
-- convert base64 CLOB to BLOB (mimetype: image/png)
l_blob := apex_web_service.clobbase642blob(p_clob => l_clob_base64);
--
-- create own collection
-- check if exist
IF NOT
apex_collection.collection_exists(p_collection_name => l_collection_name) THEN
apex_collection.create_collection(l_collection_name);
END IF;
-- add collection member (only if BLOB not null)
IF dbms_lob.getlength(lob_loc => l_blob) IS NOT NULL THEN
apex_collection.add_member(p_collection_name => l_collection_name,
p_c001 => l_filename, -- filename
p_c002 => l_mime_type, -- mime_type
p_d001 => SYSDATE, -- date created
p_blob001 => l_blob); -- BLOB img content
END IF;
--
END;
```

####Excluding page areas from getting rendered
If you would like to exclude some areas from getting rendered to the resulting image, just add

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


##Demo Application
https://apex.oracle.com/pls/apex/f?p=57743:14
https://apex.oracle.com/pls/apex/f?p=APEXPLUGIN

##Preview
![](https://github.com/Dani3lSun/apex-plugin-apexscreencapture/blob/master/preview.gif)
Expand Down
4 changes: 2 additions & 2 deletions apexplugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "APEX Screen Capture",
"version" : "1.4",
"version" : "1.5",
"description" : "This plugin allows you to take screenshots/captures of pages or parts of it, directly on the users browser.",
"keywords" : ["screenshot", "capture", "pages", "screen"],
"homepage" : "https://github.com/Dani3lSun/apex-plugin-apexscreencapture",
Expand All @@ -25,7 +25,7 @@
"plugin" : {
"internalName" : "DE.DANIELH.APEXSCREENCAPTURE",
"type" : "dynamic action",
"demo" : "https://apex.oracle.com/pls/apex/f?p=57743:14",
"demo" : "https://apex.oracle.com/pls/apex/f?p=APEXPLUGIN",
"previewImage" : "https://raw.githubusercontent.com/Dani3lSun/apex-plugin-apexscreencapture/master/preview.gif"
}
}
Expand Down

0 comments on commit dfb0766

Please sign in to comment.