0

I am not sure if this is possible, but can a PDF be opened in a window without a URL?

I've seen sites where an additional window will open like a pop-up, and it will not have an address bar.

If this is possible with JQuery, how can I edit my code to make this happen:

$('#resultsTable').on('click', 'tr > td > .openPDF', function()
{
  var $dataTable = $('#resultsTable').DataTable();
  var tr = $(this).closest('tr');
  var rowData = $dataTable.row(tr).data();

  var rowBookingNum = rowData.JOB_REFERENCE;
  var partnerCode = rowData.SHIPPER_CODE;

  // path to PDF
  var pdf = '../PartnerUploads/' + partnerCode + '/' + rowBookingNum + ".pdf";  

  $.get(pdf)
  .done(function() 
  {
    window.open(pdf); 
  }).fail(function(textStatus)
  {
    if(textStatus.status == 404)
    {
      return false;
    }
  });
});
halfer
  • 19,824
  • 17
  • 99
  • 186
John Beasley
  • 2,577
  • 9
  • 43
  • 89
  • 1
    Even if a PDF is located in your own computer and you opened it with a browser, it is still using a url. Ex: `file:///C:/Users/Admin/Desktop/folder/folder/ebook.pdf`.The window still has a url with or without an address bar. As long as a browser is used, a url is involved usually – zer00ne Jun 28 '18 at 15:59
  • 2
    If you are thinking about doing a popup window most browsers dont allow you to hide the address bar any more. [You can read more about that here](https://stackoverflow.com/questions/2909645/open-new-popup-window-without-address-bars-in-firefox-ie). An alternate way would be to use a [modal window which you can read about here](https://stackoverflow.com/questions/13305707/how-to-display-a-pdf-in-a-modal-window). – crazymatt Jun 28 '18 at 16:03

1 Answers1

1

I came across this site: https://pdfobject.com/

Really simple to use. Solved my problem.

John Beasley
  • 2,577
  • 9
  • 43
  • 89