Code Monkey home page Code Monkey logo

Comments (14)

Dicky1 avatar Dicky1 commented on May 30, 2024 1

oke solved thanks

from hugo-embed-pdf-shortcode.

Dicky1 avatar Dicky1 commented on May 30, 2024

Screenshot_20210306_000425

from hugo-embed-pdf-shortcode.

anvithks avatar anvithks commented on May 30, 2024

@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.

anvithks avatar anvithks commented on May 30, 2024

@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.

anvithks avatar anvithks commented on May 30, 2024

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.

Dicky1 avatar Dicky1 commented on May 30, 2024

Screenshot_20210306_022038

still the same pdf file does not appear

from hugo-embed-pdf-shortcode.

anvithks avatar anvithks commented on May 30, 2024

Have you copied the pdf-js files as per step 3 in the setup here?

from hugo-embed-pdf-shortcode.

Dicky1 avatar Dicky1 commented on May 30, 2024

Already, is it possible that my pdf file is too big?

from hugo-embed-pdf-shortcode.

anvithks avatar anvithks commented on May 30, 2024

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.

Dicky1 avatar Dicky1 commented on May 30, 2024

Github

that's my repository for this problem

from hugo-embed-pdf-shortcode.

anvithks avatar anvithks commented on May 30, 2024

@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.

image

from hugo-embed-pdf-shortcode.

Dicky1 avatar Dicky1 commented on May 30, 2024

I've moved the file in the pdf-js folder I think it's still the same

Screenshot_20210308_122459

may check my latest repository

blog-hugo

from hugo-embed-pdf-shortcode.

anvithks avatar anvithks commented on May 30, 2024

I figured it out.
The PDF file is inside the /post folder.
image

This is the folder structure.
image

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.

anvithks avatar anvithks commented on May 30, 2024

Closing since the issue was resolved.

from hugo-embed-pdf-shortcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.