Converts html to docx with pandoc - pandoc

I would like to convert my html report to docx. I put 2 images side by side on my docx page.
For my first try, I just use this html below and I can achieve what I need:
<div>
<img width="256px" height="256px" src="imga1.png"/>
<!-- I use this to simulate margin-right -->
<span> </span><span> </span><span> </span><span> 
</span>
<img width="256px" height="256px" src="image2.png"/>
<div>
Now I would like to add a header for each image and that creates complication.
As an assumption, my first text header will not exceed 256px (because it is the image's size). And 256px corresponds to 16 "&emsp".
Then I compute my text header image by using a canvas 2d context method in javascript (text metrics).
After that I substract 256px by my computed text width and compute the number of "&emsp" that I need to fit the first image.
With this method, I can put my header for my 2 images but it is not efficient because my text second header image is not always aligned to the second image.
I am looking methods to put my image header all aligned to images.

Related

how to add boundary to an image in webpage

<html>
<h3> MY FIRST WEBPAGE </h3>
<H1> DESIGNING MY FIRST WEBPAGE </H1>
<title> MY FIRST TAB </title>
<img src="3333.jpg"
width="800"
height="500" >
<style>
body {font:12px Verdana,Arial; color #428bca; background-color:#5bc0de}
</style>
</html>
how to add boundary to image . ineed to knwo like how toadd a red coloured boundary to enclose the image in a table format
Add Borders to a Images using HTML & CSS
Using HTML/CSS to add borders to an image is easier than what you think. Before you add an image to your post in the text module, you need to switch to the text editor. Then, you will add the image and see the HTML code of the picture. This will look like the following images.

After adding the image to the text module, type this style=”border:5px solid #000000; padding:3px; margin:5px” to add the borders to your images. It will look like the next picture.

As result of that code, the image will look similar to the next picture.

Feel free to make any change to the border width, color, padding, and margin to your images. Also, you can change to the visual editor after you are done with the picture to see the changes that you’ve made. Let us know below if you have any comments or questions; we’d love to hear from you.

Vue2: change Images without repeating HTTP request for already loaded images

I am working on a product page which has an Image gallery on the left and color selections on the right.
See the below image.
Now every time a color is selected a set of image has to be shown on the left. The way it is implemented right now is that every time the color selection is updated the store value for SelectedImages changes with the array of that particular color.
Now it makes sense that, whenever I switch to a new color the image is loaded. Which is happening.
But the issue I am facing is that whenever the color is changed, and the SelectedImages array is updated the images are loaded, no matter that they were loaded earlier. I don't want it to load again (send http) when it has already called the image once.
Also, I don't want to load all the images (4 color x 4 images = 16 Images) at once which would again be not performant.
I have created this UI using vue. It's not a vue single app, but it has vue component at some places where needed.
Code that renders Image.
<div class="desktop-gallery"
:class = "{ 'is_loading': isLoading }"
v-bind:style="parentStyle"
v-show="!onlyMobile">
<div class="gallery-item"
v-for="(image, index) in images" :key="index"
ref="variableGallery"
#click="handleGalleryZoom(index)"
>
<img :src="image"/>
</div>
</div>

Aligning images next to eachother within a div

I have two images contained in one div and am trying to align the second image next to the first. If I assign each image a class, how can I get the second image to be aligned with the first using css? Or is it best to have a div for each image?
<div class="standard">
<img src="images/room02.jpg"/>
<img src="images/room04.jpg"/>
</div>
You don't need a separate div or class for each image. It all depends on how you want to align them. Just see this guide for more information: http://www.inmotionhosting.com/support/edu/website-design/insert-images-website/align-float-images-css

Specify Thumbnail Dimensions in Microdata for RichSnippets

I added metadata tags for our products as specified by http://schema.org, for use by RichSnippets, etc...
It works great except that our products only have 3x2 images, and google resizes them to square for the RichSnippets, which causes them to look terrible.
I've seen examples where
Is there a way to specify the dimensions of an image tagged as itemprop="thumbnailUrl" (or itemprop="image") without changing the image's actual size?
Edit: injecting PageMap (as seen in http://support.google.com/customsearch/bin/answer.py?hl=en&answer=1626955) data didn't work for me, as the rest of the page is done with microdata.
Edit: My object is http://schema.org/Recipe, which doesn't include width or height for its thumbnailUrl object.
Make a copy of your thumbnail images resized or cropped to look fine as a square, as this is what SE will show, then use the meta tag with content to specify using those thumbnails instead of the ones you show on your webpages.
e.g.
<div itemscope itemtype="http://schema.org/Recipe">
..
<meta itemprop="thumbnailUrl" content="http://my/optimized/thumbnail/url.png" />
<image src="http://this/is/the/thumbnail/not/resized.png" />
..
</div>

Incorrectly calculating dialog box position because of dynamic image loading?

I'm working on a gallery type application - one template puts together a popup dialog for a larger view of thumbnail images when clicked. The server path to the image is included as a template variable.
Gallery.Templates.Popup = "\
<div class='popup'>\
<img class='popup-image' src='{{image-path}}' />\
<div class='name'>{{name}}</div>\
<div class='caption'>{{caption}}</div>\
<div class='dimensions'>{{dimensions}}</div>\
<div class='price'>{{price}}</div>\
</div> \
";
This works very well EXCEPT for the first time the image is loaded. The dialog is constructed and shown but at the time the html string is attached to the dom, it lacks the image. The problem it is causing is in positioning the dialog:
The dialog box is positioned in the middle of the screen like this:
left = window.width /2 - dialog.width/2
But since the image is not present, the dialog.width variable is incorrect. Again, this only happens the first time a thumbnail is clicked, I'm guessing the image is cached for subsequent clicks.
Would this be handled by prefetching the images somehow? If so, do they need to be attached to the dom in order to be cached or can I just load them in an array?
Many Thanks !
If you can get the image size ahead of time from the server, you could use that to help you size the '.popup' div appropriately.
It sounds like a bad idea to prefetch images if they aren't needed and I can't think of a way to ensure that a specific image is loaded before it's html is generated programmatically.

Resources