{"id":56699,"date":"2022-08-25T03:01:39","date_gmt":"2022-08-24T17:01:39","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=56699"},"modified":"2022-08-25T20:09:42","modified_gmt":"2022-08-25T10:09:42","slug":"image-and-text-pdf-sharing-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/image-and-text-pdf-sharing-tutorial\/","title":{"rendered":"Image and Text PDF Sharing Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/pdfimageplustext.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image and Text PDF Sharing Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/pdfimageplustext_share.jpg\" title=\"Image and Text PDF Sharing Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image and Text PDF Sharing Tutorial<\/p><\/div>\n<p>Onto yesterday&#8217;s <a title='Image and Text PDF Primer Tutorial' href='#itpdfpt'>Image and Text PDF Primer Tutorial<\/a> &#8220;Image and Text PDF&#8221; creator start, today we wanted to link in with our previous <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/web-share-api-primer-tutorial\/' title='Web Share API Primer Tutorial'>Web Share API Primer Tutorial<\/a> work to offer <i>some of our users<\/i> the chance to share their work.  Yes, it&#8217;s <i>some of our users<\/i> here because the <a target=_blank title='Web Share API' href='https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Navigator\/share'>Web Share API<\/a> interfacing does not work on all platforms and only works for <i>https:<\/i> protocol URLs.<\/p>\n<p>Also in the winds today is the <a target=_blank title='Unique identifier information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Unique_identifier'>&#8220;uniquifying&#8221;<\/a> of media filenames for their limited lifespan.<\/p>\n<p>And in a wind <font size=1>(<a target=_blank title='?' href='https:\/\/www.google.com\/search?q=wind+called+mariah+lyrics&#038;rlz=1C5CHFA_enAU973AU973&#038;oq=wind+called+&#038;aqs=chrome.0.69i59j69i57j46i67j46i512j46i10j0i15i22i30j0i22i30l4.16617j0j15&#038;sourceid=chrome&#038;ie=UTF-8'>called Mariah<\/a>)<\/font> we convert our PDF to a JPEG image via the great <a target=_blank title='ImageMagick' href='http:\/\/www.imagemagick.org'>ImageMagick<\/a> &#8230;<\/p>\n<p><code><br \/>\nconvert -density 300 pdffilename.pdf pdffilename.jpg<br \/>\n<\/code><\/p>\n<p> &#8230; command line type of command (accessed via PHP <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'>exec<\/a> conduit) along the way, because that might come in handy down the line.<\/p>\n<p>And then, &#8220;down the line&#8221;, we realized that for Safari platform work where a PDF is shown within an HTML iframe scenario, that JPEG image can immediately help, it being that (onclick event) intermediary between the iframe and opening PDF in a new window (but not good in the iframe element).<\/p>\n<p>See this in action with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/pdfimageplustext.php-GETME\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/pdfimageplustext.php-GETME\">pdfimageplustext.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/pdfimageplustext.php\" title=\"Click picture\">Image and Text PDF<\/a> <font size=1>(still a blank webpage without the user interaction, at this first draft)<\/font> PHP web application (helped out by <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/web_share_api_test.html---GETME \">the changed HTML and Javascript<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/web_share_api_test.html---GETME\">web_share_api_test.html<\/a> <a target=_blank href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/web_share_api_test.html\">Web Share API supervisor<\/a>) you can also <a href='#trpdfit'>try below<\/a>.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/image-and-text-pdf-sharing-tutorial\/'>Image and Text PDF Sharing Tutorial<\/a>.<\/p-->\n<hr>\n<p id='itpdfpt'>Previous relevant <a target=_blank title='Image and Text PDF Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/image-and-text-pdf-primer-tutorial\/'>Image and Text PDF Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/pdfimageplustext.jpg\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Image and Text PDF Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/pdfimageplustext.jpg\" title=\"Image and Text PDF Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Image and Text PDF Primer Tutorial<\/p><\/div>\n<p>We are restarting our interest in our &#8220;Timesheet Filling In Automator&#8221; web application long standing dream from another angle today.  We want to &#8230;<\/p>\n<ul>\n<li>create PDF data via the <a target=_blank title='FPDF library' href='HTTP:\/\/www.fpdf.org\/'>FPDF<\/a> PHP library &#8230; where we &#8230;<\/li>\n<li>base the PDF on a single image (at this stage) &#8230; and &#8230;<\/li>\n<li>allow for any number of x,y,text combinations placed on top of the image above &#8230; and &#8230;<\/li>\n<li>allow for Font Family and Font Style and Font Size (with a mantissa on x means to change the Font Size for individual text nodes)<\/li>\n<\/ul>\n<p> &#8230; for this early days &#8220;proof of concept&#8221; and &#8220;just the workings, not the user interaction&#8221; with our &#8220;first draft&#8221; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/pdfimageplustext.php_GETME\">pdfimageplustext.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/pdfimageplustext.php\" title=\"Click picture\">Image and Text PDF<\/a> <font size=1>(blank webpage without the user interaction, at this first draft)<\/font> PHP web application you can see in the example usage below &#8230;<\/p>\n<table style='width:100%;'>\n<tr id='trpdfit'>\n<th><a target=_blank href='\/\/www.rjmprogramming.com.au\/pdfimageplustext.php?pdfimageplustext=y&#038;pdfimage=moodle.jpg&#038;pdftext1=Moodle%20Page&#038;pdfx1=230&#038;pdfy1=250'>Open Link of Content Below in New Window &#8230;<\/a> or change that URL just below &#8230;<br \/><a target=_blank style='padding: 3 3 3 3;' title='Can change URL or wait 8 seconds for navigation to occur' id=\"acelink\" data-ce='' onclick=\"if (this.getAttribute('data-ce').length == 0) {  this.style.textDecoration='none';  this.style.backgroundColor='#e0e0e0';  setTimeout(function(){ if (document.getElementById('acelink').getAttribute('data-ce').length == 0) { document.getElementById('acelink').setAttribute('data-ce','n');  document.getElementById('acelink').setAttribute('contenteditable', !document.getElementById('acelink').getAttribute('contenteditable')); document.getElementById('acelink').click();  } },8000); }\" onkeydown=\"this.setAttribute('data-ce','y'); this.title='Will navigate to your new URL.';\" href=\"https:\/\/www.rjmprogramming.com.au\/pdfimageplustext.php?pdfimageplustext=y&#038;pdfimage=moodle.jpg&#038;pdftext1=Moodle%20Page&#038;pdfx1=230&#038;pdfy1=250\" \n onblur=\" this.style.textDecoration='underline';  this.style.backgroundColor='white'; \n this.href=this.innerHTML.replace(\/\\&#038;amp\\;\/g,'&#038;'); this.setAttribute('contenteditable', !this.getAttribute('contenteditable')); this.click();\" contenteditable=true>https:\/\/www.rjmprogramming.com.au\/pdfimageplustext.php?pdfimageplustext=y&#038;pdfimage=moodle.jpg&#038;pdftext1=Moodle%20Page&#038;pdfx1=230&#038;pdfy1=250<\/a>\n<\/th>\n<\/tr>\n<tr>\n<td><iframe id='ifpdfit' src='\/\/www.rjmprogramming.com.au\/pdfimageplustext.php?pdfimageplustext=y&#038;pdfimage=moodle.jpg&#038;pdftext1=Moodle%20Page&#038;pdfx1=230&#038;pdfy1=250' style='width:100%;height:900px;'><\/iframe><\/td>\n<\/tr>\n<\/table>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d56693' onclick='var dv=document.getElementById(\"d56693\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/pdf\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d56693' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d56699' onclick='var dv=document.getElementById(\"d56699\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/api\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d56699' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Onto yesterday&#8217;s Image and Text PDF Primer Tutorial &#8220;Image and Text PDF&#8221; creator start, today we wanted to link in with our previous Web Share API Primer Tutorial work to offer some of our users the chance to share their &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/image-and-text-pdf-sharing-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,29,37],"tags":[88,1707,234,2650,405,4072,2430,590,1658,913,932,997,1083,1133,1137,1254,2225,1319,2231,1899,4031],"class_list":["post-56699","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-operating-system","category-tutorials","tag-api","tag-co-ordinates","tag-command-line","tag-convert","tag-exec","tag-filling-in","tag-fpdf","tag-image","tag-imagemagick","tag-pdf","tag-php","tag-programming","tag-safari","tag-share","tag-sharing","tag-text","tag-timesheet","tag-tutorial","tag-uniquifier","tag-units","tag-web-share-api"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/56699"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=56699"}],"version-history":[{"count":11,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/56699\/revisions"}],"predecessor-version":[{"id":56719,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/56699\/revisions\/56719"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=56699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=56699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=56699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}