blazor html image tag convert to pdf - base64

I'm using blazor c# and i can generate PDF using RDLC, I have this html code with data in it using database and i want to add that image into RDLC
Example code below.
<img class="img-thumbnail" src="#data.QRCodeBase64" title="#data.tbl_req_document_header.qr_code" />

Related

How to add SVG as background image in Django template

Pls how can I add SVG as background image in Django
I have tried and it's not working
I added the svg in this format url("image.svg") but nothing is showing.
you can load image form static like this in Django
<body style="background-image: url('/static/images/test_image.svg');">
``` code here ````
</body>

Uploading picture using PXImageUploader

I am trying to upload image on my custom page and following are the code in aspx source
<px:PXImageUploader ID="edImageUrl" runat="server" AlreadyLocalized="False" DataField="ImageUrl" DefaultLocale="" AllowNoImage="True" FlexRatio="False" MagnifyDefault="False" ShowComment="False" ViewOnly="False" AllowUpload="True" Height="320px" Width="430px" DataMember="lotserailrec" >
</px:PXImageUploader>
The image uploads and attached to custom page if I drag and drop on the image and it is not uploading through file selection.

object pdf type is not render in mozilla and chrome

Im doing a document searching system, that shows a list of pdf like response, I´m working with primefaces 5
this is my code
<h:outputLink value="file/#{document.pdfPath}" target="_blank" >view document</h:outputLink>
<div id="pdf2">
<object data='file/#{document.pdfPath}'
type='application/pdf'
width='700px'
height='400px'>
<p>It appears your Web browser is not configured to display PDF files.
No worries, just <a href='file/#{document.pdfPath}'>click here to download the PDF file.</a></p>
</object>
<div id="pdf">
<object data="http://www.gnu.org/software/hello/manual/hello.pdf" type="application/pdf" width="450" height="375"></object>
</div>
But this is the problem in eclipse and IE browser runs perfect,but in chorme and mozilla only show the pdf that doesn´t come from a managed bean.
it is what I´m watching
With chrome
With mozilla
and finally Internet explorer (works perfect here)
Here, from your response headers:
Content-Disposition: attachment; filename="contratotest.pdf"
Your /file servlet is serving the PDF as an attachment. This is intented for the "Save As" dialogue thing. If you intend to display the content inline in the web page instead of as an attachment of the web page, then you need to set it to inline.
response.setHeader("Content-Disposition", "inline");
Or just remove it entirely. It's the default already. You may only need to add an extra parameter to the fallback link to force attachment anyway when clicked.

LIFERAY:Embed flash in Web Content Display

I have a requirement where in a page is to be duplicated. This page has several image appearing with effects. It has images path stored in xml file & effects in flash files. I am using web content display, when i include just the plain swf files output is blank . I have included other .swf files in flash link they are working fine.But this .swf files need images so its blank. I have tried making a portlet, passing images in array and then giving transitions through javascript but the same effect is not achieved more over when i include portlet in my website my theme & other WCD is disturbed so i have dropped portlet way. But other than this how can the image be passed to WCD on a flash link.Please help as how the image & flash to be embeded in web content display.
My Actual page has xml :
<?xml version="1.0" encoding="utf-8" ?>
<slides>
<slide imageUrl="/images/home/A_397x930px.jpg" />
<slide imageUrl="/images/home/B_397x930px.jpg" />
<slide imageUrl="/images/home/C_397x930px.jpg" />
<slide imageUrl="/images/home/D_397x930px.jpg" />
</slides>
My flash code :
<script language="javascript" type="text/javascript">
var so = new SWFObject("/andiosp-flash.swf", "mymovie", "930", "398", "8", "#ffffff");
so.addParam("quality", "high");
so.addParam("wmode", "transparent");
so.addParam("allowFullScreen", "true");
so.addParam("salign", "t");
so.write("flashcontent");
</script>
I am using Liferay 6.1
If you store your images in a theme, e.g. "your-theme", then you should try to access them by URLs:
/your-theme/images/home/an-image.jpg
This is the same for the other Liferay plugins.
The second way is to upload images while creating "Web Content Display" portlet:
Click "Image" button on the WYSIWYG toolbar
In tab "Image Info" click "Browse Server"
Then you'll be able to choose an existing image or upload new image in the repository
After you choose an image, you'll see the URL for this image in the field "URL"
You may also consider to upload images in "Documents and Media" portlet. Choose "Control Panel" -> "Documents and Media" and add your image as "Basic Document". Then you'll be able to click on uploaded image and get its URL provided by Liferay Portal.

Convert Google Geochart to image (JPEG, PNG, etc.) or PDF in the browser

I'm using Google GeoCharts (https://developers.google.com/chart/interactive/docs/gallery/geochart#Overview) to dynamically generate color-coded maps in the browser. The geochart api draws the maps using javascript/svg... any advice for generating an exportable image file? (pdf, raster image, etc.)
Can this be done through google geocharts? If not, is there another service you can recommend?
*We were previously using GeoMaps but the resolution was not suitable.
This can be done by following the steps on this page. Note that the code in the article is based on an old version of Google Visualization which used iframes, and will not work as posted. However, you can do the same using the following code (found in the comments):
var svg = $(chartContainer).find('svg').parent().html();
var doc = chartContainer.ownerDocument;
var canvas = doc.createElement('canvas');
canvas.setAttribute('style', 'position: absolute; ' + '');
doc.body.appendChild(canvas);
canvg(canvas, svg);
var imgData = canvas.toDataURL("image/png");
canvas.parentNode.removeChild(canvas);
return imgData;
Note: I did not create this code, it was originally created by the author of the above site (Riccardo Govoni) and updated in the comments section by user Thomas.
This is very well possible; I do this by exploiting the SVG to image converter from Highcharts. You simply find the svg code in the page and POST that to the highcharts exporting server along with a type paramater (e.g. image/jpeg), as width, and the filename to save it as.
Only downside: IE is not rendering SVG but VML for Google visualizations. No solution there yet, but it seems Highcharts also have difficulties with IE and VML to SVG conversions. So no luck there I'm afraid.
<form method="post" action="http://export.highcharts.com/" id="imageGetForm">
<input type="hidden" name="filename" value="savedFromGoogleVisualization" />
<input type="hidden" name="type" id="imageGetFormTYPE" value="" />
<input type="hidden" name="width" value="900" />
<input type="hidden" name="svg" value="" id="imageGetFormSVG" />
</form>
and execute the following script:
var svg=document.getElementById('chart_div').getElementsByTagName('svg')[0].parentNode.innerHTML;
$('#imageGetFormTYPE').val('image/jpeg');//e.g. image/jpeg application/pdf etc
$('#imageGetFormSVG').val(svg);
$('#imageGetForm').submit();
Working example here: http://jsfiddle.net/P6XXM/

Resources