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;
    }
  });
});
2
  • 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 Commented Jun 28, 2018 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. An alternate way would be to use a modal window which you can read about here. Commented Jun 28, 2018 at 16:03

1 Answer 1

1

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

Really simple to use. Solved my problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.