Viewed 4k times
I was trying to figure out how to generate and display a pdf in a Unity app.I would like the app, and pdf to be available for iOS, Android and web app. Following this tutorial I was able to generate a pdf file and store in the app main folder within the simulator.
A concise guide to almost all the C# you’ll ever need to know code-wise to make a PS4 game in Unity Alex Rose, @AlexRoseGames This guide is to teach yourself. I’d advise not watching youtube tutorials where someone spends 20. Aug 10, 2015 Unity 3d SharpPdf C# generation and display. Ask Question 2. I was trying to figure out how to generate and display a pdf in a Unity app. I would like the app, and pdf to be available for iOS, Android and web app. Following this tutorial I was able to generate a pdf file and store in the app main folder within the simulator.
Unfortunately when I try to open the pdf inside the app using
It does not work.
I also tried iTextSharp with poor outcome and I believe it is not free anymore.
Any suggestion would be more than welcome.
C Sharp For Unity Pdf
Thanx
UPDATE
So I tried to move forward but I'm kind of stuck in the middle: I tried Gallorini's modified SharpPDF program, the generated pdf document, which I called 'NewPDF.pdf' is stored in main application folder. Indeed when I run the code in the Editor I'm able to find it in there.I built a simple gui button and attached a void to it running this c# code to display the document as your suggestion:
when I click the button nothing happens except of course console records Button Clicked.
When I build the program for the web player the pdf is not generated although ApplicationOpenURL works and I am able to display a previously generated pdf by the editor.. I am a bit confused.
When I built the program for Mac Osx nothing happens at all.
Free cpanel download for windows. On iPhone I get this log from Xcode console:
I am totally confused. Could you please help me out.
Instagram cracker download. Thanx again.
UPDATE #2
I partially solved the problem: https://hitstree539.weebly.com/ir-adv-c5235-driver-download.html.
I was able to generate the .pdf file in Unity Editor and in Standalone application on OSX. I realized I had trouble on storing/loading files in Unity.
![C sharp for unity pdf C sharp for unity pdf](https://www.packtpub.com/media/catalog/product/cache/e4d64343b1bc593f1c5348fe05efa4a6/v/0/v08995_mockupcover.png)
The code to retrieve and open the file:
So far everything works perfectly.
The pain comes with ios.
Microsoft mouse lost dongle. I was able to generate a pdf file with the above code in Application.persistentDataPath and getting it back from iTunes (to verify it was created) enabling UIFileSharingEnabled under info.plist. Here's the code:
C# For Unity Pdf
The trouble is when I try to Application.OpenUrl(path). It seems that c# code is blind to Application.persistentDataPath. Which by the way is /var/mobile/Containers/Data/Application/'ApplicationName'/Documents/'pdfName'.pdf using
I tried also to save the file in StreamingAssets folder but Xcode didn't like it:
UnauthorizedAccessException: Access to the path '/private/var/mobile/Containers/Bundle/Application/F105683E-B2EA-4B0C-81B7-61302C58D56C/PdfReader.app/Data/newPDF.pdf' is denied. at Mono.Security.Cryptography.RSAManaged.GenerateKeyPair () [0x00000] in :0 at System.IO.FileStream.ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in :0 at System.IO.FileStream.ctor (System.String path, FileMode mode) [0x00000] in :0 at sharpPDF.pdfDocument.createPDF (System.String outputFile) [0x00000] in :0 at simplepdf+c__Iterator1.MoveNext () [0x00000] in :0
(Filename: currently not available on il2cpp Line: -1)
![C For Unity Pdf C For Unity Pdf](/uploads/1/3/4/2/134243370/804952805.jpg)
I then decided to get this wrapper
but it can only copy already formatted pdf file from StreamingAssets folder to /Raw folder on iOS device.
I am thinking I have to write my own wrapper to load data from Application.persistentDataPath on iOS, have you got any suggestion to start with?
Thank you again.
dottorfeelgood
Learn C Sharp For Unity Pdf
dottorfeelgooddottorfeelgood