I just installed the latest static build of wkhtmltopdf-amd64 (0.12.3). On any html page I convert to PDF, the text appears as solid squares.
Example of google's homepage as PDF:
[acoder#box bin]# ./wkhtmltopdf-amd64 http://google.com goog.pdf
Or, here's an even simpler HTML source doc:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
</head>
<body>
<p>Hello world.
<table><tr><td>I am a table</td></tr></table>
<pre>formatted</pre>
</body>
</html>
Output:
What could be causing this?
This was due to a missing dependency, urw-fonts. After that was installed, converted text is readable.
For clarity & documentation on a minimal install of EL7:
Grab the wkhtmltopdf-amd binary and unpack to a temporary location.
Install dependencies: yum install libXrender libXext fontconfig urw-fonts
Test the binary with wkhtmltopdf-amd -V - this should print the version (0.12.3 as of today).
Next test that it converts documents as expected. wkhtmltopdf-amd http://google.com googlehomepage.pdf
If the output PDF looks good, then copy the binary to /usr/bin and call it done.
Related
Please consider this question:
Based on https://golang.org/doc/tutorial/call-module-code, I've:
$ cat hello.go
package main
import (
"fmt"
"example.com/greetings"
)
func main() {
// Get a greeting message and print it.
message := greetings.Hello("Gladys")
fmt.Println(message)
}
and,
$ cat go.mod
module hello
go 1.14
replace example.com/greetings => ../greetings
require example.com/greetings v0.0.0-00010101000000-000000000000
It loads the greetings module from my local folder, and goes its way.
In real life, greetings is a module I use a lot, so I lug that folder around a lot so I can use my it.
To avoid this, how can I setup my own URL of this folder, and use it? That is, I can copy that folder to say, https://mywebsite.com/myGoThings/greeting - just a plain apache server which is open for GETs. (I do not want to use github, I'd prefer my own https endpoint.)
When I try this, go get mywebsite.com/myGoThings/greeting complains : no go-import meta tags () and quits.
If this is possible, could you please show me how to accomplish this?
update 1
This is my greetings folder as in mywebsite.com/myGoThings/greeting:
$ ls greetings/
go.mod greetings.go import.html
import.html:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Go Imports -->
<meta name="go-import" content="GOIMPORT">
<meta name="go-source" content="GOSOURCE">
<meta http-equiv="refresh" content="0; REDIRECT">
</head>
<body>
</body>
</html>
When you have any custom domain else github.com, gitlab.com, etc. The first step is to add a ssh-key to your system, then set the GOPRIVATE environment variable. after a logoff you can use your own private repository.
The official golang documentation describes how to that.
I am developing a Magento 2.3 site which was working but has stopped. When I try to get a page up, I get a blank screen. Although it looks empty, it actually contains a little content:
<!doctype html>
<html lang="en">
<head >
<meta charset="utf-8"/>
<meta name="description" content="Blah Blah"/>
<meta name="keywords" content="More blah blah"/>
<meta name="robots" content="INDEX,FOLLOW"/>
<title></title>
<link rel="icon" type="image/x-icon" href="http://www.magento2.domain/pub/media/favicon/stores/1/3-ladies-bg.jpg" />
<link rel="shortcut icon" type="image/x-icon" href="http://www.magento2.domain/pub/media/favicon/stores/1/3-ladies-bg.jpg" />
<link href='https://fonts.googleapis.com/css?family=Prosto+One' rel='stylesheet' type='text/css' />
<!--xxxabb2c66c7681e8f658-->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxx-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-131267613-1');
</script> </head>
<body data-container="body" data-mage-init='{"loaderAjax": {}, "loader": { "icon": "http://www.magento2.domain/pub/static/version1551796553/frontend/_view/en_GB/images/loader-2.gif"}}' class="cms-index-index page-layout-1column">
</body>
</html>
If I look in the system log, I see the following errors:
[2019-04-30 21:24:48] main.INFO: Broken reference: the 'theme.active.editor' element cannot be added as child to 'after.body.start', because the latter doesn't exist [] []
[2019-04-30 21:24:48] main.INFO: Broken reference: the 'logger' element cannot be added as child to 'after.body.start', because the latter doesn't exist [] []
I've enabled error logging but I get nothing. Can anyone help?
Alternatively, can somebody point me to a good map (or similar) of how magento 2 builds a page so I can try and track down the error.
I have tracked down the issue to a problem with pub/generated/metadata/global.php. Even regenerating it causes the same problem. If I delete the file everything seems to work ok. I confess to not understanding why!
I now avoid this by not running bin/magento setup:di:compile. I simply run php bin/magento setup:static-content:deploy.
I think this error is due to a broken reference in some XML file. You have not mentioned in which page you are getting this error. But you can trace it as below:
First of all, rename your default.xml from below path:
app/design/frontend/Vendor/Theme_name/Magento_Theme/layout/default.xml
Flush all the cache and check(php bin/magento cache:flush)
If you don't find anything then rename your page(homepage, listing, detail page, etc) related file.
For example, if you are getting this error on the homepage then rename cms_index_index.xml.It can reside in your theme or any custom extension.
Hopefully, this information can help you with the issue.
remove everything under generated folder except .htaccess file
I am using Magento 2.3.2 version. In production mode generating generated directory using setup:di:compile is working fine. However, in developer mode doing same is making all pages on frontend blank but not empty (content inside body tag is empty) so I deleted the generated folder and let it be created automatically as I access the site pages. Doing this resolved the issue for me.
Just go to Magento directory and then delete file generated by di:compile is path :-
magento\generated\metadata\global.php delete this file then after refersh your page.
This is temporary solution for this error in local server.
When a project is created by the Vue-CLI 3, a public/index.html is created.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Website</title>
</head>
<body>
<noscript>
<strong>We're sorry but the website doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
I would like to add an external CSS file into the head, but the source file is in SASS/SCSS. The reason I would like this file is to style the markup around the Vue app (<div id="app">/<div>), like the <body> element.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Website</title>
<link href="[I want to reference a compiled SCSS file here]" rel="stylesheet" type="text/css" />
</head>
<body>
<noscript>
<strong>We're sorry but the website doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
I read the Vue-CLI 3 guide on CSS, https://cli.vuejs.org/guide/css.html, but I am under the impression that the advice on that page is for integrating SASS into single-file components (*.vue files), like allowing single file components to access global SASS variables. Can I get the Vue-CLI 3 build process to compile a SASS file that isn't directly related to any of the *.vue files but is still part of the Vue app for deployment purposes?
I cannot find an answer to my specific question.
However, I did find a discussion in the Vue Loader Github repo.
https://github.com/vuejs/vue-loader/issues/328#issuecomment-363165459
https://github.com/vuejs/vue-loader/issues/328#issuecomment-363189176
Basically, any global styles that do not contain SASS variables or mixins can be imported into App.vue's style block without a 'scoped' attribute.
<style lang="scss">
#import './scss/main.scss';
</style>
Any Vue component that needs access to SASS variables will require a small change to Vue.config.js
// vue.config.js
module.exports = {
css: {
loaderOptions: {
// pass options to sass-loader
sass: {
// #/ is an alias to src/
// so this assumes you have a file named `src/variables.scss`
data: `#import "#/variables.scss";`
}
}
}
}
I need to create a static version of a Joomla website. I'm using wget to download files. But the downloaded files have a base url that point to the live site.
If I remove the tag, then the local files become a mess, since references to css, javascript etc. start with a slash and Chrome errors with "Not allowed to load local resource"
Here some source code from the downloaded site:
<base href="http://www.example.com/" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Home - My Site</title>
<link href="/templates/mytemplate/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<link href="/templates/mytemplate/css/template.css" rel="stylesheet" type="text/css" />
<link href="/templates/mytemplate/css/custom.css" rel="stylesheet" type="text/css" />
<script src="/templates/mytemplate/js/template.js" type="text/javascript"></script>
Does anyone have an idea how to create a good local static copy of a site? What setting am I maybe missing in wget?
To make a really static copy of a site, you need to specify both -k (--convert-links) and -p (--page-requisites):
$ cd <target-dir>
$ wget -k -p http://www.example.com
$ cd www.example.com
$ firefox index.html
This is not Joomla specific, though.
I have a .odc file from which i am connecting with oracle data in excel everything is working fine annd i want to give this access to my colleague but the file which i am giving to him is editable in notepad from which he can easily able to see password so i want to protect this file to be edited and i want to encrypt this file please help
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/x-ms-odc; charset=utf-8">
<meta name=ProgId content=ODC.Database>
<meta name=SourceType content=OLEDB>
<title>(Default)</title>
<xml id=docprops><o:DocumentProperties
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns="http://www.w3.org/TR/REC-html40">
<o:Name>(Default)</o:Name>
</o:DocumentProperties>
</xml><xml id=msodc><odc:OfficeDataConnection
xmlns:odc="urn:schemas-microsoft-com:office:odc"
xmlns="http://www.w3.org/TR/REC-html40">
<odc:Connection odc:Type="OLEDB">
<odc:ConnectionString>Provider=MSDASQL.1;Persist Security Info=True;Extended Properties="**DSN=ALPHA;UID=ALXLIE;PWD=BAC123;**DBQ=ALXORCL;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;MLD=0;ODA=F;STE=F;TSZ=8192;AST=FLOAT;";Initial Catalog=(Default)</odc:ConnectionString>
<odc:CommandType>Table</odc:CommandType>
<odc:SSOApplicationID>786</odc:SSOApplicationID>
<odc:CredentialsMethod>Stored</odc:CredentialsMethod>