I've just installed wkhtmltopdf which converts webpages to pdfs.
I can run it from the command line on the server like so:
wkhtmltopdf http://www.google.co.uk c:\google.pdf
wkhtmltopdf was added added to the path environmental variable. The real path to the exe is C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe
I now want to run this with ColdFusion 8 using cfexecute.
<cfexecute name="c:\Program Files\wkhtmltopdf\wkhtmltopdf.exe"
arguments="wkhtmltopdf http://www.google.com c:\google.pdf"
timeout="10" />
I've tried a few different variations but can't seem to get it to work.
I've also had some "error 5 access is denied" messages but I understand this still might be a syntax issue rather than a rights issue.
Can anyone see issues with my code?
OK GOT IT WORKING!...
<cfexecute name="c:\Program Files\wkhtmltopdf\wkhtmltopdf.exe"
arguments="http://www.google.com C:\google.pdf"
timeout="10" />
Syntax is a bit different from the command line I ran in windows.
Did you know that ColdFusion has the ability to convert HTML to PDF built-in? See the cfdocument tag.
Here is a very simple example that should work:
<cfhttp method="get" url="http://www.google.com" timeout="10" />
<cfif cfhttp.StatusCode EQ "200 OK">
<cfdocument format="PDF" localurl="false">
<cfoutput>#cfhttp.FileContent#</cfoutput>
</cfdocument>
<cfelse>
<p>http request failed [<cfoutput>#cfhttp.StatusCode#</cfoutput>]</p>
</cfif>
I don't know the extent of the functionality that you need from the PDF converter but for simple conversions the cfdocument tag works pretty well.
Related
My tensorflow is installed on ubuntu 16.04 and also generates log files, but when running tensorboard there is nothing on Google Chrome. There was no error on the command line.
This error only appears on Google Chrome. What can I do to display it properly?
This file is deprecated. Please use
iron-flex-layout/iron-flex-layout-classes.html, and one of the
specific dom-modules instead
thinkpad/:39507 This file is deprecated. Please use
iron-flex-layout/iron-flex-layout-classes.html, and one of the
specific dom-modules instead
thinkpad/:157058 Uncaught TypeError: Object.values is not a function
It's possible you're using Chrome version 49 or earlier: https://caniuse.com/#search=object.value
I mailed out tensorflow/tensorboard#1089 to solve this problem. Please note there might be other things in our codebase that are incompatible with old browsers. I'd like to improve this situation. Please email jart#google.com if you encounter similar problems.
It especially helps if you can send a screenshot of the code in question. For example, if Chrome says JavaScript broke on line 48238, you can run wget -O index.html http://localhost:6006/ and nano +48238 index.html so you can take a screenshot of the code in question. (Note: This will get easier in the future.)
I'm currently porting and old Perl-based application into AWS. I successfully made Perl run alongside Apache 2.4 and even got my PostgreSQL database up and running.
Then I proceeded configure Apache's httpd.conf to properly load all the resources necessary for the system to work. I got most of them up and running after some research. However, I simply can't get around LoadModule perl_module modules/mod_perl.so
From what I've researched so far, mod_perl.so has been deprecated in Apache 2.4 on RHEL 7, and as indicated on RHEL 7's website this module should be replaced by something else - they suggest mod_fcgid, but after discussing the issue internally, we decided to go with PSGI's CGI::Emulate::PSGI and CGI::Compile as our replacement, basically because it would allow us to not mess up hundreds of old scripts to change print orders.
However, I can´t get them to work. Trying to call them withing a script causes Perl to not find CGI::Compile, and attempting to install this module through CPAN results in an error MIYAGAWA/CGI-Compile-0.22.tar.gz : writemakefile NO '/usr/bin/perl Build.PL ' returned status 512
Below is an example of the code I´m using (file myPSGIScript.psgi):
#!/usr/bin/perl
use strict;
use CGI::Compile;
use CGI::Emulate::PSGI;
my $sub = CGI::Compile->compile("/var/www/cgi-bin/testScript.pl");
my $app = CGI::Emulate::PSGI->handler($sub);
Where testScript.pl is a simulation of one of our scripts, including calls to CGI and other modules that we need, placed on the same folder:
#!/usr/bin/perl
use strict;
use CGI qw/:standard :html/;
$CGI::HEADERS_ONCE++;
$|=1;
print header;
use Pg;
my $test = param('test');
print <<BlocoWeb;
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>AWS Test</title>
</head>
<body>
<center>
<h1>
I'm working - $test -
</h1>
<br>
<form action='./testScript.pl'>
<input type='text' name='test' value='$test'>
<input type='submit'>
</form>
</center>
</body>
</html>
BlocoWeb
Am I misunderstanding how these libraries are supposed to work? Do I need to import them on Apache's httpd.conf or something? Or is it something else? Should I give up on this idea and use mod_fcgid instead - and how?
Also, mod_perl is what enables us to set certain parameters inside <VirtualHost> tag that are crucial for our application to work, namely PerlOptions +GlobalRequest, PerlModule and PerlSetVar. Is there a way using this method that would allow these to be set?
For reference, I'm on RHEL 7, Apache 2.4.6, Perl 5.16.3 inside Amazon's AWS.
EDIT: This is not the answer I was looking for, but it actually solved my issues, so I believe it's worth adding to this post just in case.
After a lot of research, I figured out from Amazon's knowledge base that you can actually get your hands on mod_perl.so on RHEL 6 and 7 and other distributions they proide. All you have to do is enable their Extra Packages through the proper command. In my case:
sudo yum install –y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
After running the appropriate command, run sudo yum repolist and check if the following repositories are available:
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64
rhui-REGION-rhel-server-optional/7Server/x86_64 Red Hat Enterprise Linux Server 7 Optional (RPMs)
If they are, you're ready to go and run sudo yum install -y mod_perl and it should be available for loading on Apache's conf file.
Again, this solved my issues for the moment but Red Hat's message is clear: don't use this unless you absolutely need to. If you can, upgrading your code to another newer module is the best thing to do.
I tried to install solidity extension for Visual Studio 2017, I downloaded VSIX Installer from the link bellow:
https://marketplace.visualstudio.com/items?itemName=ConsenSys.Solidity
when I tried to run the VSIX file, the installation failed immediately with the given message:
"Install Failed
The install of the extension was not successful for all the selected products. For more information, click the install log link at the bottom of the dialog.
This extension is not installable on any currently installed products."
I also tried to read the log file but it is very huge and many different things happened there. I appreciate if someone who had the same experience and fixed it could advice me how to fix it.
For anyone who is trying to install on VS 2017 just open the extract the package and then edit the extension.vsixmanifest to change the wrongly added brackets to square brackets. As below:
<InstallationTarget Version="[14.0,15.0]" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[14.0,15.0]" Id="Microsoft.VisualStudio.Community" />
<InstallationTarget Version="[14.0,15.0]" Id="Microsoft.VisualStudio.Enterprise" />
If still you face issue, With out converting to .zip file, do " Open Archive " - With in that edit the files as below
<Installation>
.... Version="[14.0,15.0]"
.... Version="[14.0,15.0]"
.... Version="[14.0,15.0]"
</Installation>
<Dependencies>
.... Version="[4.5,]"
</Dependencies>
save the file and run as it. ( Here there is no conversion from vsix to zip and back - edit is direct on the vsix ) - Installation is success for me.
The page says "Works with Visual Studio 2015".
I have created an React+Redux using the .Net Core 2.0 template. I didn't change anything yet it's not buildind.
Severity Code Description Project File Line Suppression State
Warning MSB3073 The command "node --version" exited with code
1. WebApplication2 C:\Tests\WebApplication2\WebApplication2\WebApplication2.csproj 25
Yet, node is properly installed, when I run "node --version" in a prompt (from any drive/directory) I get v8.4.0 and no error code (the expected behaviour).
I tried using the full path in the .csproj file.
<Exec Command=""C:\Program Files\nodejs\node" --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
And I'm still getting the same error
Severity Code Description Project File Line Suppression State
Warning MSB3073 The command ""C:\Program Files\nodejs\node" --version"
exited with code
1. WebApplication2 C:\Tests\WebApplication2\WebApplication2\WebApplication2.csproj 25
I reinstalled NodeJS, with the same results.
Then I even tried a dummy task calling dos echo 0 and it still fails.
Severity Code Description Project File Line Suppression State
Warning MSB3073 The command "echo 0" exited with code
1. WebApplication2 C:\Tests\WebApplication2\WebApplication2\WebApplication2.csproj 25
What's going on?
Here's the whole segment which does the check:
<Target Name="DebugRunWebpack" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('wwwroot\dist') ">
<!-- Ensure Node.js is installed -->
<Exec Command=""C:\Program Files\nodejs\node" --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
<!-- In development, the dist files won't exist on the first run or when cloning to
a different machine, so rebuild them if not already present. -->
<Message Importance="high" Text="Performing first-run Webpack build..." />
<Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js" />
<Exec Command="node node_modules/webpack/bin/webpack.js" />
</Target>
This had been related to security issue of some sort.
Running "dotnet run" from a command prompt run with admin rights "fixed" the issue.
I ran into this issue (I realized that my node_modules folder wasn't there) so I upgraded my .Net Core app to 2.1 and ran npm i and that worked.
Doesn't hurt to just try npm i and try again
I have a python script that is doing some deployment.
I want to run that script from msbuild and get the output in case it pass, or failed.
So, how can I communicate to msbuild of the status , and the error text?
I want to show the result on the build server.
I have to use python 2.7, and cannot use 3.x
Run the command using the Exec task and capture it's output. For example:
<Target Name="GetPythonOutput">
<PropertyGroup>
<PyCommand>/path/to/python.exe -a /path/to/pthonfile</PyCommand>
<TempFile>ExecTempFile</TempFile>
</PropertyGroup>
<Exec Command="$(PyCommand) > $(TempFile)" />
<ReadLinesFromFile File="$(TempFile)">
<Output TaskParameter="Lines" ItemName="PyOutput"/>
</ReadLinesFromFile>
<Delete Files="$(TempFile)" />
<Message Text="Python command output was: #(PyOutput)" />
</Target>
If you are using .Net 4.5 things are better since Exec can do most of the work for you