How do i give the option to either read pdf now or download it?

by ncloud
11 replies
How do you set up your download page so that people have both options - they can either open the pdf in the browser or save it to their computer to read later.

The book has affiliate links in it. But not everybody is going to be in the mood to read the book right away so I also want to give them the option to be able to download it as well.

I have a button and when you click it the book opens in the browser. It does not open in a new window which I would like it to. How do you get it to open in a new window? And how do you also give them the option to download it to their computer?
#download #give #option #pdf #read
  • Profile picture of the author Kurt
    To open in a new tab, use the _new or _top attribute for the link in the html. You can google how to do this.


    To download the pdf, zip it and upload it to your host and link to the .zip file.
    Signature
    Discover the fastest and easiest ways to create your own valuable products.
    Tons of FREE Public Domain content you can use to make your own content, PLR, digital and POD products.
    {{ DiscussionBoard.errors[10741520].message }}
  • Profile picture of the author ncloud
    Let me be more specific because I'm using different code than what I'm seeing when I google it, because I'm using buttons. Here's my current code:

    [button color="orange" link="Link to my PDF"]Read the book[/button]

    And here's the kind of code I'm seeing when google it:

    <a href="url" target="_blank">...</a>

    I've seen other code, but they all look different from mine.

    Also, do you have to zip the pdf with a certain program? I have 7zip and it wants to put a 7z on the end of the file.
    {{ DiscussionBoard.errors[10741558].message }}
  • Profile picture of the author CyberDav
    Create a new page and embed the pdf on that page: https://pdfobject.com/

    And then have a button link to the page that has the embedded pdf.

    For the download pdf, just do this:

    <a href="url to pdf" target="_blank"><button>Download</button></a>

    You don't need to zip it.
    {{ DiscussionBoard.errors[10742151].message }}
  • Profile picture of the author ncloud
    That first part looks a bit too complicated for me - embeding the pdf.

    The second part didn't work. The pdf opens in a new window when you click the button rather the downloading. So I guess it does have to be zipped. But again, not sure how to zip. 7 zip puts a 7z on then end of the file. Not sure if i need to use another program to zip it. Also this method made my nice rounded orange button gray and square.
    {{ DiscussionBoard.errors[10742418].message }}
  • Profile picture of the author ncloud
    Ok this works for the download option:

    [button color="orange" link="URL to zipped pdf"]Download[/button]

    But, I can't get the other option to open in a new tab to work. Here is my code:

    [button color="orange" link="URL to unzipped pdf"]Read Now[/button]

    Can I add the ...

    rel="nofollow" target="_blank"

    somewhere to make it work?
    {{ DiscussionBoard.errors[10742434].message }}
  • Profile picture of the author yukon
    Banned
    Try this code to open an online pdf in a browser, works on Chrome and Firefox (desktop).



    HTML Code:
    <a href="#" onclick="window.open('https://www.finewoodworking.com/media/TabletopsFlat.pdf', '_blank')">View online pdf in a browser</a>
    {{ DiscussionBoard.errors[10742527].message }}
  • Profile picture of the author ncloud
    They does work, but I lose my nice looking orange button.
    {{ DiscussionBoard.errors[10742549].message }}
    • Profile picture of the author yukon
      Banned
      Originally Posted by yukon View Post

      Try this code to open an online pdf in a browser, works on Chrome and Firefox (desktop).



      HTML Code:
      <a href="#" onclick="window.open('https://www.finewoodworking.com/media/TabletopsFlat.pdf', '_blank')">View online pdf in a browser</a>
      Originally Posted by ncloud View Post

      They does work, but I lose my nice looking orange button.

      Just change from anchor-text to your image button HTML code (example: my-button-image.jpg).

      Image code below...




      HTML Code:
      <a href="#" onclick="window.open('https://www.finewoodworking.com/media/TabletopsFlat.pdf', '_blank')"><img src="http://domain.com/images/my-button-image.jpg"></a>
      {{ DiscussionBoard.errors[10742845].message }}
  • Profile picture of the author David Beroff
    This is a case of "less is more":

    1. Don't zip or otherwise compress the PDF. Bandwidth is cheap enough nowadays that there's practically zero upside, and plenty of downside, such as support calls from people who can't figure out how to unzip the file.

    2. Unless your server has an odd configuration, the easiest thing to do is to let your visitors make the choice to read it now (left-click) or later (right-click and Save). i.e., The standard link will let them do either, so you're only making your life more complex by trying to do anything special. Simply tell them how, e.g., "(Right-click to Save to your computer, or simply left-click to read it now.)".

    3. The target="ebook" part is correct, but it looks like you're using some sort of simplified interface to the code. See if there's a "edit raw HTML" option which will then let you place that attribute inside the <a ...> tag.

    [The rel="nofollow" part is being added by the WF site; I did not put that in my reply. Don't use that unless you choose to do so.]
    Signature
    Put MY voice on YOUR video: AwesomeAmericanAudio.com
    {{ DiscussionBoard.errors[10742828].message }}
  • Profile picture of the author smsmarket26
    you use simply print command and save it .
    {{ DiscussionBoard.errors[10743278].message }}
    • Profile picture of the author David Beroff
      Originally Posted by smsmarket26 View Post

      you use simply print command and save it .
      Expand on this please.
      Signature
      Put MY voice on YOUR video: AwesomeAmericanAudio.com
      {{ DiscussionBoard.errors[10743406].message }}

Trending Topics