0

So currently I have a list of PDF files that are displayed on a page with a link to their location. How would I go about downloading or viewing the file without using external libraries?

Currently the URL to the PDF's location just opens a new tab which is a blank web page without showing the PDF.

I'll post my code below. any help would be greatly appreciated!

<div class="body">
                    <div class="scroll-container">
                        <table>
                            <tbody>
                            <tr dir-paginate="action in test | itemsPerPage: 14">
                                <td class="date"><a href="{{ action.Url }}" target="_blank">{{ action.Name }}</a></td>
                                <!--<td class="date"></td>-->
                            </tr>
                            </tbody>
                        </table>
                    </div>

                    <div class="total-container">
                        <div class="top">
                            <div class="pagination">
                                <dir-pagination-controls></dir-pagination-controls>
                            </div>
                        </div>
                    </div>
                </div>**strong text**
GingerFish
  • 457
  • 3
  • 11
  • 26

2 Answers2

0

Right now, the pdf is opening in a new tab because of target target="_blank". This is the default browser behavior. If you want to open the pdf in the same tab, then you can use an iFrame.

<iframe ng-src="{{action.Url}}" width="800px" height="600px"></iframe>
Abhishek Prakash
  • 964
  • 2
  • 10
  • 24
  • Opening in a new tab is what i want to happen, I just can't seem to view the PDF, sorry if that wasn't implied. – GingerFish Jun 27 '16 at 09:44
0

I managed to fix it myself but thanks!

<td class="date"><a href="MyIPAddressHere{{ action.Url }}" target="_blank">{{ action.Name }}</a></td>
GingerFish
  • 457
  • 3
  • 11
  • 26