how I can get full URL of images when using getPageHTML of dokuwiki xmlrpc api - api

I want to embed the HTML content of a dokuWiki page inside another web application. The content should be shown as a tooltip popup. But when I use the 'wiki.getPageHTML' api method to get the content, embedded images dont have the full path in their tag.
Like: <img src="/mywiki/lib/exe/fetch.....">
Is it possible to get the full image path in HTML code?
E.g.: <img src="https://testwiki.com/mywiki/lib/exe/fetch....">

This option do the job: https://www.dokuwiki.org/config:canonical
thx for andi who answered my question here.

Related

Fit PDF page in container using ngf-thumbnail

I have the following line of code to embed pdf in HTML
<embed ngf-thumbnail="factura.picFile" id="factura_prev_pdf" ng-show="factura.preimageext=='pdf'" class="view_complete_image" type='application/pdf'>
As you can see I'm using ngf-thumbnail to show the pdf.
Javascript attached to the id just get the extension, not important here.
ng-show say true if extension id pdf and the css class adapt the pdf to the container size.
The thing is that the pdf preview is adapted to the width and height but the page is not visualized entirely.
Any idea ?
I saw things like Zoom to fit: PDF Embedded in HTML
But it doesn't work to me since I'm not using
EDIT what I see now is that you can modify a pdf url like http.thingthing.pdf#view=fit to make page fit but my files are loaded from local so it creates a blob:url where I cannot put this view=fit.
It's possible to convert this blob url to a normal url with the pdf extension?
Finally I achieved the following:
<img ngf-thumbnail="factura.picFile" id="factura_prev_image" class="view_complete_image">
<embed ngf-thumbnail="factura.picFile" id="factura_prev_pdf" ng-show="factura.preimageext=='pdf'" class="view_complete_image" type='application/pdf'>
<img src="{{ factura.image.url }}" ng-show="factura.preimage && factura.preimageext=='jpg'" id="factura_image" class="view_complete_image">
<embed src="{{ factura.image.url }}#view=fit" ng-show="factura.preimage && factura.preimageext=='pdf'" class="view_complete_image" type='application/pdf'>
As you can see, in the first 2 lines I'm using ngf-thumbnail... This two fields contains local files so to visualize it we get a Blob Url, in this way I couldn't add the #view=fit that allows me to visualize the entire pdf page.
In the last 2 lines we get pdf's that are uploaded to a server so we get a normal url.
In this way I can add the #view=fit so the page fits.
Hope it helps to someone.
This answer is to know how to fit a pdf page, but I'm not answering to fit the page when we get a Blob Url.

How do I create a html line divider in shopify that resembles my design attached below?

I'm trying to recreate the attached image below inside of a custom html field on my website using HTML code only . Can you share advice on where is best practice to place this custom code too please (e.g.inside the liquid.theme or should I create a custom HTML field in the content editor)? Thank you kindly for guidance beautiful people!
Where exactly are you trying to add the image? (Product page, home page, etc.)
First you need to upload the image to Shopify in Settings -> Files and copy the url. Then add the url to the image tag <img src="your-image-url.png" alt=""> and finally place that line of code in your template file.
Something else you can do if you are familiar with Sketch/Adobe software, is create the image in one of those programs and export the SVG code. Then use that code in your template file.

Google+ Sharer - preview image

I am using links like this : https://plus.google.com/share?url=www.myurl.com to share articles on Google+ from a website.
This works fine but the preview image of the share is not right.
I read in the Google doc that you need to specify an image like this:
<img itemprop="image" src="thumbnail.jpg" />
The thing is, the image I want to use is not being displayed on the page I want to share. I have specific thumbnail images (of smaller size than the images displayed in the article) that I'd like to use.
Is there a way to specify an image for Google, like the og:image tag for Facebook for example, without having to use the tag?
Is there a way to specify an image for Google, like the og:image tag for Facebook for example, without having to use the tag?
https://developers.google.com/+/plugins/snippet/:
2. Open Graph protocol
If the page contains Open Graph properties for the title, image, and description, they will be used for the +Snippet.
Additionally, the schema.org tag that defines your page's preview image does not need to be displayed on the page, you could instead define it within your HEAD as metadata:
<meta itemprop="image" content="thumbnail.jpg" />

Checking the contains of an embed tag using Selenium

We generate a pdf doc via a call to a web service that returns the path to the generated doc.
We use an embed html tag to display the pdf inline, i.e.
<div id="ctl00_ContentPlaceHolder2_ctl01_embedArea">
<embed wmode="transparent" src="http://www.company.com/vdir/folder/Pdfs/file.pdf" width="710" height="400"/>
I'd like to use selenium to check that the pdf is actually being displayed and if possible save the path, i.e. the src link into a variable.
Anyone know how to do this? Ideally we'd like to be able to then compare this pdf to a reference one but that's a question for another day.
As far as inspecting the pdf from selenium, you're more or less out of luck. The embed tag just drops a plugin into the page, and because a plugin isn't well represented in the DOM, Selenium can't get a very good handle on it.
However, if you're using Selenium-RC you may want to consider getting the src of the embed element, then requesting that URL directly and evaluating the resulting PDF in code. Assuming your embed element looks like this <embed id="embedded" src="http://example.com/static/pdf123.pdf" /> you can try something like this
String pdfSrc = selenium.getAttribute("embedded#src");
Then make a web request to the pdfSrc url and do (somehow) validate it's the one you want. It may be enough to just check that it's not a 404.

How to download file from inside Seam PDF

In out project we are creating a pdf by using seam pdf and storing that pdf in the database.
The user can then search up the pdf and view it in their pdf viewer. This is a small portion of the code that is generated to pdf:
<p:html>
<a:repeat var="file" value="#{attachment.files}" rowKeyVar="row">
<s:link action="#{fileHandler.downloadById()}" value="#{file.name}" >
<f:param name="fileId" value="#{file.id}"/>
</s:link>
</a:repeat>
When the pdf is rendered, a link is generated that points to:
/project/skjenkebevilling/status/status_pdf.seam?fileId=42&actionMethod=skjenkebevilling%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById()&cid=16
As you can see this link doesnt say much, and the servletpath seems to be missing.
If I change /project with the servletpath
localhost:8080/saksapp/skjenkebevilling/status/status_pdf.seam?fileId=42&actionMethod=skjenkebevilling%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById%28%29&cid=16
Than the download file dialog appears. So my question is, does anyone know how I can input the correct link? And why this s:link doesnt seem to work?
If I cannot do that, then I will need to somehow do search replace and edit the pdf, but that seems like a bit of a hack.
(This is running under JBoss)
Thank you for your time....
I found a workaround for this problem.
Seems I have to use s:link together with a normal a href tag.
Only having href tag doesn't work for some reason.
<s:link action="#{fileHandler.downloadById()}" value="#{file.name}" propagation="none">
<f:param name="fileId" value="#{file.id}"/>
</s:link>
<a href="#{servletPath.path}?fileId=#{file.id}&actionMethod=#{path.replace('/','')}%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById()&">
download
</a>
The servletPath.path returns the servlet path ie http://mydomain.com/download.seam
You can decide to put login-required=true on the download.seam if you want users to login before downloading a file.
#Observer("org.jboss.seam.security.loginSuccessful")
public void servletPath() {
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
this.path = request.getRequestURL().toString().replace("login.seam", "download.seam");
}