create or replace package DOCX_ADDINLINEIMAGE is
   -- Required procedure
  procedure genDOCX;
 
  -- Required variable
  v_docx blob;
   
  
end DOCX_ADDINLINEIMAGE;
/
create or replace package body DOCX_ADDINLINEIMAGE is
/* 2016-JAN-26 10:30 */
/* PL/PDF REPORTER 3.7.0 */
l_paragraph1 pls_integer;
l_text_idx1 pls_integer;
l_paragraph2 pls_integer;
l_paragraph3 pls_integer;
l_text_idx2 pls_integer;
l_imageBlob1 blob;
l_image1 pls_integer;
l_text_idx3 pls_integer;
function image_util( 
p_name varchar2
) return blob is
l_ret blob;
begin 
SELECT IMAGE_FILE INTO l_ret FROM PLPDF_REPORTER_IMAGE WHERE FILENAME = p_name;
return l_ret;
end;
procedure genDOCX is
 begin 
ploffx_docx.init( );
/* START PARAGRAPH */
l_paragraph1 := ploffx_docx.crParagraph();
l_text_idx1 := ploffx_docx.addText( p_paragraph_id => l_paragraph1, p_text => 'AddInlineImage', p_fontSize => 16);
ploffx_docx.addParagraph(p_paragraph_id => l_paragraph1);
/* START PARAGRAPH */
l_paragraph2 := ploffx_docx.crParagraph();
ploffx_docx.addParagraph(p_paragraph_id => l_paragraph2);
/* START PARAGRAPH */
l_paragraph3 := ploffx_docx.crParagraph();
l_text_idx2 := ploffx_docx.addText( p_paragraph_id => l_paragraph3, p_text => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut placerat libero, eu lobortis ante. Suspendisse sagittis felis sem, a ullamcorper libero semper eget. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam semper mi orci, ultrices tincidunt magna ultricies quis. Ut sodales nisi ac tincidunt auctor. Mauris ac tellus massa. Fusce ornare porttitor orci, vitae ornare nulla congue eu. Quisque vehicula, nisl id vestibulum gravida, tellus metus sollicitudin tortor, dignissim semper tellus elit quis quam. Aenean placerat mi eu ligula blandit blandit. Curabitur ut volutpat sapien. Nullam sed nisl enim. Proin id cursus quam.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut placerat libero, eu lobortis ante. Suspendisse sagittis felis sem, a ullamcorper libero semper eget. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam semper mi orci, ultrices tincidunt magna ultricies quis. Ut sodales nisi ac tincidunt auctor. Mauris ac tellus massa. Fusce ornare porttitor orci, vitae ornare nulla congue eu. Quisque vehicula, nisl id vestibulum gravida, tellus metus sollicitudin tortor, dignissim semper tellus elit quis quam. Aenean placerat mi eu ligula blandit blandit. Curabitur ut volutpat sapien. Nullam sed nisl enim. Proin id cursus quam.', p_fontSize => 14);
l_imageBlob1 := image_util( p_name => 'koala.jpg');
l_image1 := ploffx_docx.addInlineImage( p_paragraph_id => l_paragraph3, p_name => 'koala.jpg', p_file => l_imageBlob1, p_width => 46, p_height => 26);
l_text_idx3 := ploffx_docx.addText( p_paragraph_id => l_paragraph3, p_text => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut placerat libero, eu lobortis ante. Suspendisse sagittis felis sem, a ullamcorper libero semper eget. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam semper mi orci, ultrices tincidunt magna ultricies quis. Ut sodales nisi ac tincidunt auctor. Mauris ac tellus massa. Fusce ornare porttitor orci, vitae ornare nulla congue eu. Quisque vehicula, nisl id vestibulum gravida, tellus metus sollicitudin tortor, dignissim semper tellus elit quis quam. Aenean placerat mi eu ligula blandit blandit. Curabitur ut volutpat sapien. Nullam sed nisl enim. Proin id cursus quam.', p_fontSize => 14);
ploffx_docx.addParagraph(p_paragraph_id => l_paragraph3);
ploffx_docx.getDoc( p_blob_file => v_Docx);
end;
end DOCX_ADDINLINEIMAGE;
/
