Displaying / Linking To A PDF - wordpress

i have just finished building a new website (wordpress), and i have a very strange problem linking to a PDF file.
I've uploaded a file to my website - http://goo.gl/tNxXYc - however when i enter the link in my browser it says that the page cannot be found, instead of showing the pdf.
Can anyone suggest what the problem might be? Thanks in advance for your help.

well, the given google.gl shortcode forwards to https://www.grasshopperlanguagecentre.com/wp-content/uploads/2014/11/hello.pdf
and that file does not exist.
So find the correct location of hello.pdf and link to that.

Please check permission of folder where pdf stored. Also try if any of following plug can solve your issue :
https://wordpress.org/plugins/search.php?q=pdf&sort=

Related

WordPress: Images and other assets not loading on localhost

First of all, a cordial greeting, friends! I have a problem, I am working with the design of a web page using WordPress via localhost with XAMPP. I have tried to view the project from different devices (cellphones, tablets) and by configuring the file httpd-XAMPP.config I have managed to enter the address correctly of the project.
The problem is that no image, icon, or logo that I have placed on the page loads (as seen in the attached image), the menu button does not work either.
With nothing more to add and thanking you in advance for any help you can provide, I say goodbye.
Have you checked the image path to see if it's correct?
Are you able to access the image from the full path in a browser for example
domain.com/wp-content/uploads/image.png like this?
Probable solution 1:
Most of the cases, it can be the permalink issue.
Please try to check by changing the permalink, first make it Plain Text and check, if it's not working then make it Post Name and then check. (To do it go to Admin dashboard > Settings > Permalink)
Probable solution 2:
Sometimes, if the image and CSS do not exist in the correct location then happen this kind of issue. Please check it.
Probable solution 3:
Put it in the config.php file
define('WP_HOME','yourdomain.com');
define('WP_SITEURL','yourdomain.com');
Thank you

Wordpress: how to know which page is requesting a specific css file

I am helping out a friend with a slow WP. I installed hummingbird and it's telling me that some css files are slow to load (for example: https://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.2/TweenMax.min.js - it takes 390ms to load). I would like to store this file locally and see if the performance improves. The problems is that I'm not sure about how to locate the file that is actually requesting this css file. Any help is appreciated.
I suggest a sweet plugin I use called String locator. It will search the whole site for a string like TweenMax.min.js. It will also search by plugin. When it find it it gives options to edit straight to the file. Hope this helps.

CSS Saving Error with Dreamweaver: Solution?

I'm experiencing an extremely perplexing error that I've been unable to find any posts about online.
I have a CSS file ('main.css') that is linked to my HTML file. Recently, this has started happening:
1) For some reason, upon opening the HTML file, the linked CSS file appears twice.
2) I go to file -> save all, and the dreamweaver formatting disappears, as though it's an ordinary text file. If I exit and open up the HTML again, the changes haven't saved.
3) Also when I click file -> save all, a new css file is created in the css directory.
I honestly haven't the slightest idea what's going on here, and would appreciate any assistance that could be rendered!
Is your Dreamweaver connected to FTP server where the actual website CSS is present online?

404 error empty CSS file

My CSS files do exist. They just don't have anything inside - they are empty.
Chrome however, show 404 errors for my CSS files.
Putting some dummy code e.g. comments in a CSS file makes the error goes away.
Any idea what went wrong for me?
Updates:
The document root of the website is /var/www/html/niuniu/.
Some of you mentions permission issue but how does it explain the issue when I put in some comments in the CSS file and the error went away - no changes in permission?
I'm using Prestashop but I don't believe that has to do with the issue here.
It appears this is just how Chrome's Developer Tools and Firebug report empty CSS file. This is not a real error that can break my website.

Outputting Images in ASP FPDF problem

Hi
I'm attempting to use the ASPFPDF class to output an image on a pdf using the very simple code below:
<!--#include file="fpdf.asp"-->
<%
Dim pages
Dim pdf
Set pdf=CreateJsObject("FPDF")
pdf.CreatePDF "P", "mm", "A4"
pdf.SetPath "fpdf/"
pdf.Open()
pdf.AddPage("P")
pdf.Image "invoiceheader.jpg"
pdf.Output ()
%>
When run, this script should open the pdf but with Adobe Reader I get a "File does not begin with %pdf" message. I've tried using other readers with similar results.
If I remove the image line and output some text (e.g. pdf.Cell 40,5,"Date",0,1,"R"), everything works perfectly.
Anyone got any ideas before I go mad!
Thank you.
Try this one
pdf.Image "IMAGES/invoiceheader.jpg", 140, 22, 50, 40
Here 140 is the x position, 22 is the y-position 50 is the width and 40 is the height.
I don't know AspFPdf, but don't you need to specify a folder where the image is to be found ?
Did you try ?
pdf.Image "fpdf/invoiceheader.jpg"
As I said, I don't know the component, just my thoughts (although you have propably tried this yourself).
[EDIT] Look at the website of Asp Fpdf and saw the following in the documentation:
file
Path or URL of the image.
Asp fPdf : Image parameter
Anyway: thanks for pointing me in the direction of this component (even though this was not your intention). I can use this too ;-)
Just thought I'd update people as I've spent ages and have finally got this working. What you don't see due to random error messages is that the FPDF application creates a temporary PDF as it's building it. By default, it will create it in the same folder as your asp page that runs it.
e.g. My page was in my web root \createpdf.asp
I worked out that it was trying to create a file called D10456.tmp (name changes each time) in my web root but it couldn't due to security.
I added an output file name and changed the security in another folder to allow write access and it worked first time.
Code for output file:
pdf.Output server.mappath("pdfs\list.pdf"),"F"
The PDFS folder must have write access to work.
Hope that helps people.
The answer by Paul is also correct for the format of adding an image in ASP.
Also, I had to change the images.asp file which is located in the includes directory.
I had to change the line:
this.Buffer.LoadFromFile(Server.MapPath("\\") + ("\\") + ("Images") + ("\\") + pFileName);
to
this.Buffer.LoadFromFile(Server.MapPath(pFileName));
because it was looking in the wrong folder for my images.
The answer to the above question is that the FPDF seems to need to be on a fully qualified domain - I was running on a machine with using a custom hosts file to point the URL at the development server. As soon as I moved the code to the live server, everything worked!
I don't fully understand why, but this might help someone else...
I found that the only way I could add images was as follows:-
pdf.Image "./byimage.jpg",x,y,width
This is how i manage to display my image in ASP classic page:
pdf.Image "fpdf/header.jpg", 10, 10,80,20, "jpg"
if not mistakes, this is how to define the variables (correct me if i'm wrong):
pdf.image "folder/image.type", x-coordinate, y-coordinate, img width, img height, "image type"
hope it helps. because i've spent many days just to find how to display the image in my asp classic page..

Resources