cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Show a PDF file in Thingworx Studio

Highlighted
Newbie

Show a PDF file in Thingworx Studio

Hi everyone,

I'm trying to show a PDF file in my thingworx studio experience, but i did not see any widget to do this.

I tried to import a PDF file in resources folder, create a $ionicPopup in the javascript file and in the ​template​ section i wrote HTML code to show PDF file, like this:

$scope.popup = function() {

    var options = {

      cssClass: 'popup-custom',

      title: "PDF!",

      template: "<iframe src='app/resources/Uploaded/prova.pdf' frameborder='0' style='width: 100%; height: 600px'></iframe>",

      okText: "Close"

    }

    var popup = $ionicPopup.alert(options);

    popup.then(function(res) {

      //do something

    })

}


​In ​preview​ mode I see my PDF file correctly, but if I use a mobile device (with the Thingworx View app), I don't see my PDF, only white area.. I think I need to import something.. I tried to import the PDF.js library, but it did not work..

Anyone can help me?

Thanks,

Alessio

Message was edited by: Sushant Pandey moved to ThingWorx Studio

Tags (3)
1 REPLY 1

How to resize pop up window to match my PDF file?

Hi, I was able to view my pdf file, however my pop up window width is very small. Please help on how to change the size of the popup window..

I tried to change the value of the width in my js and css but the pop up window width remains small. (not changing at all)

 

below is my js:

$scope.show = function() {
var alertPopup = $ionicPopup.alert
({

cssClass: 'popup-custom',
title: "Flexure Assembly!",
template: "<iframe src='app/resources/Uploaded/Flexure Assembly.pdf' frameborder='0' style='width: 100%; height: 500px'></iframe>",
okText: "Close",
})
};

 

Pls help.. thank you!