HowTo -> Use the PDF Widget (Demo)

There is more you can do with this widget, see here. (And thank @hmwillett .. again) We will cover that later.

Anyway, from this thread →

I said I would show a demo. So here it is in all it’s glory.

pdefdemo

First, I created a library to contain some demo data.
PawelPDFDemo.efxj (120.9 KB)

It has 2 functions.
One returns a DataSet with some PDF Data in Base64 format.
The other is just a little helper that retrieves the Base64 Data from the Notes Section in the function.
Yep, I just shoved the pdf in the notes. This is a demo after all lol.

Edit → That data in the notes is on the main function, and you clear it out before commit.
The structure looks like this:

Code Refs

  • Assembly → Newtonsoft.Json
  • Service → ICE:Lib:EfxLibraryDesigner

Function → ReturnPDFDS

//using Newtonsoft.Json;
//Signature
//Response -> output (DataSet) 
//Response -> output2 (string) (not used)

Func<string> FunctionID = () =>
{
  var name = this.ToString().Split('.').Last();
  return name.EndsWith("Impl") ? name.Substring(0, name.Length - 4) : name;
};


Func<List<string>, string, string, DataSet> ListStringToDataSet = (list, tblName, colName) =>
{
    var ds = new DataSet();
    var tbl = new DataTable(tblName);
    tbl.Columns.Add(colName, typeof(string));
    
    list.ForEach(li =>
    {
        tbl.Rows.Add(li);
    });

    ds.Tables.Add(tbl);
    return ds;
};


string pdfJson = ThisLib.StringDataFromNotes(LibraryID, FunctionID());

var pdfB64 = JsonConvert.DeserializeObject<List<string>>(pdfJson);

output = ListStringToDataSet(pdfB64, "PDFData", "B64Data");

Function → StringDataFromNotes

//Signature
//Input -> libraryID (string)
//Input -> functionID (string)

//Response -> output (string) 

try
{
    CallService<Ice.Contracts.EfxLibraryDesignerSvcContract>(efxLibDesigner =>
    {
        output = efxLibDesigner.GetLibrary(libraryID).EfxFunction.Where(f => f.FunctionID == functionID).First().Notes;
    });  
}
catch { output = String.Empty; } //Not really needed

Kinetic App

Set up a Dashboard like this

Added a DataView

Load Data Button


Load PDF1 Button (PDF 2 is the same)

row-current-set

property-set



Teehee Shane Torres GIF by The Roku Channel

9 Likes

Kick ass that rocks!

1 Like

Just in time for the 2025.1 upgrade! :tada:

/s

1 Like

I flex.

Beavis And Butthead Flex GIF

1 Like

Updated to show the json in the notes.

A learning experience…

ineedhelppdf2

I Need Help Train Derailment GIF by GIPHY News

4 Likes

So is it doing a video or a ani-gif?

That’s 16 pdfs.

1 Like

Gurl, you do need help! :joy:

1 Like

Now to be perfectly honest, I took out the flashes where it switched. Wasn’t quite that smooth.

Sign Language Epilepsy GIF by Sign with Robert

1 Like

Ill Be Back Jim Carrey GIF

Or hold on just hear me out for a second… Can Epicor run Doom?

2 Likes

That’s fantastic!
Thank you Kevin!

1 Like

No problem. Build something cool with it and show us.

Not with the widget. At least not so far…

3 Likes