B4J Question [Webapp] Show PDF in the browser

Omar Moreno

Member
Licensed User
Longtime User
Greetings.
Can you help me with this code?
In Vb.net (WebMatrix) after creating a file in PDF memory we show it in a browser tab with this code:

B4X:
Dim ResponseX as System.Web.HttpResponseBase
...
Dim Sal AS MemoryStream.
Sal = HelperPDF(dataX)

ResponseX.addHeader("Content-Type", "application/pdf")
ResponseX.addHeader("Cache-Control", "no-cache")
ResponseX.addHeader("Content-Length","Sal.toarray.Length.tostring")
ResponseX.addHeader("Content-Disposition","inline; filename=test.pdf")
ResponseX.BinaryWrite(Sal.ToArray)
ResponseX.End()

How would you write the code above for the server in B4J?
 

ThRuST

Well-Known Member
Licensed User
Longtime User
It might be easier for the GURUs in here to help you out if you post a link to WebMatrix and the native code that is relevant to be converted to B4j (and JavaFX at all). I suppose VB.NET 3rd party tools in general are not compatible with the B4X franchise unless it's a common technology that is easily wrapped in. Just my coin, good luck.

EDIT: Specify in detail what you are trying to achieve with the source links that makes it easier to help you. Just my random bet for what you're looking for you might look at JetPDF even jOkHttpUtils2 for http jobs in case you need to transfer data through the net.
 
Upvote 0
Top