0

I'm using PDF.js to view pdf's. I'm able to open pdf in new browser window. But now I want to open pdf inside div container/tag which will be created on the fly. Sample code below:

var newTabContent = '<div id="'+tabId+'" class="tab_content" style="display: block;"></div>';
                    $('#dynamicTabContent').append(newTabContent);
                    $('#pageContent').hide();
                    $("#"+tabId).show();
                    $("#"+tabId).html(msg); 
                    $dynamicTabContent(viewerUrl);


viewerUrl = viewer.html?file + encodeURIComponent(base64_string);

This is not working. Fails with "pdfViewer is null" error.

0 Answers0