Comments (14)
oke solved thanks
from hugo-embed-pdf-shortcode.
from hugo-embed-pdf-shortcode.
@Dicky1 have you followed the steps to setup the short code correctly?
Is this on your local machine or a VM?
From the error it seems that the PdfJsLib is blocked.
from hugo-embed-pdf-shortcode.
@Dicky1
After you have setup the shortcode correctly you have to place the pdf file in the content folder where the document exists and specify the relative path to that folder.
For ex:
if your hugo site is in a folder called blog-hugo this would be an example code.
This would be a sample document /blog-hugo/content/demo-page/index.md
Your pdf file should be in the same folder as follows:
/blog-hugo/content/demo-page/LAPORAN HASIL MONITORING KEAMANAN SIBER TAHUN 2020.pdf
and in the index.md file you should use the shortcode as follows:
{{< embed-pdf url="./LAPORAN HASIL MONITORING KEAMANAN SIBER TAHUN 2020.pdf" >}}
from hugo-embed-pdf-shortcode.
Another suggestion: avoid having spaces in the file name of the PDF file. You can use -
or _
like
LAPORAN_HASIL_MONITORING_KEAMANAN_SIBER_TAHUN_2020.pdf
from hugo-embed-pdf-shortcode.
still the same pdf file does not appear
from hugo-embed-pdf-shortcode.
Have you copied the pdf-js files as per step 3 in the setup here?
from hugo-embed-pdf-shortcode.
Already, is it possible that my pdf file is too big?
from hugo-embed-pdf-shortcode.
Already, is it possible that my pdf file is too big?
What is the size of the file?
I do not think the error that you are seeing is because of that.
is it possible to push your code and share the repository with me?
I can test it locally and check if there is something that needs to be fixed.
from hugo-embed-pdf-shortcode.
that's my repository for this problem
from hugo-embed-pdf-shortcode.
@Dicky1 Got it. I pulled your repository.
One thing that needs to be fixed in your repository is in the JS folder here https://github.com/Dicky1/hugo-blog/tree/main/static/js
The build
, web
folders and LICENSE
should be inside a folder called pdf-js
.
You can take a look at the demo here
Your pdf file is OK.
I checked it on my local dev env. The filename without spaces is not a problem.
from hugo-embed-pdf-shortcode.
I've moved the file in the pdf-js folder I think it's still the same
may check my latest repository
from hugo-embed-pdf-shortcode.
I figured it out.
The PDF file is inside the /post
folder.
Move the PDF file under /post
folder.
{{< embed-pdf url="./post/LAPORAN HASIL MONITORING KEAMANAN SIBER TAHUN 2020.pdf" >}}
if you want to maintain all resources under one folder then you can create a file/
folder under the post folder.
from hugo-embed-pdf-shortcode.
Closing since the issue was resolved.
from hugo-embed-pdf-shortcode.
Related Issues (20)
- Add a progress loader before displaying the pdf file
- Scroll through pages HOT 9
- I'm sorry but, it doesn't work for me HOT 7
- PDF.js library loading broken HOT 6
- Please make PDF resizable
- Allow multiple PDF embeddings in one page HOT 10
- It doesn't work HOT 14
- Provide option to allow users to download the PDF file HOT 12
- It is working FINE locally but NOT on hosted site. HOT 3
- Undefined is not an object HOT 2
- Install as a Theme Component HOT 3
- PDF always loading, never displaying. HOT 7
- [Feature Request] Add GitHub action to implement a CI for the shortcode
- Users can view PDFs but preventing them the download HOT 2
- [Feature Request] Add translation option to add language for Next and prev buttons. HOT 4
- PDF not loading on Netlify but is OK on localhost HOT 8
- If there are pictures in the pdf, they cannot be displayed. HOT 2
- ',' expected. HOT 7
- Deploy pdf is not working HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-embed-pdf-shortcode.