Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by jaramillo · Nov 16, 2011 at 07:07 AM · filespdf

Displaying PDF

Hi, i'm trying to display a PDF file on my Mac standalone application and i have no idea how to do it. Any ideas, maybe somebody could help me?

Thanks, best regards.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ignusmart · Dec 24, 2014 at 03:06 PM 0
Share

Excuse me,I'm new in unity, someone can found the solution to this issue? (Sorry for my poor english)

avatar image ignusmart · Dec 24, 2014 at 03:08 PM 0
Share

Excuse me,I'm new in unity, someone can found the solution to this issue? (Sorry for my poor english)

5 Replies

· Add your reply
  • Sort: 
avatar image
6

Answer by Rod-Green · Nov 16, 2011 at 07:49 AM

You need to look up the PDF file format and create you're own custom PDF renderer.

Try looking through this stackoverflow thread:

http://stackoverflow.com/questions/518878/how-to-render-pdfs-using-c-sharp

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Paulius-Liekis · Aug 21, 2013 at 08:30 PM 0
Share

I tried PDFSharp and sharpPDF and they both require gdiplus.dll.

avatar image
5

Answer by fherbst · Nov 16, 2011 at 09:14 AM

Instead of using a custom PDF renderer (which could be overkill, depending on your needs), you could either

  • Preprocess the pdf to an image format, put it in a folder with the PDFs original name, and write some code to represent it like a single document with many pages. This is by far the simplest way.

  • Do the preprocessing on the fly (you select a PDF to show in Unity on runtime -> Unity starts e.g. a PDFTK process (I don't know if there is a nice PDF command line toolkit for Mac, tough) to let that render the PDF into PNG in the background -> see first solution). This would allow you to use any PDF you want.

Edit: From Rod Green's answer, I came to this link with two clicks: Using Ghostscript for PDF > JPG conversion Ghostscript (which is a pdf renderer) should even be available for Mac.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
4

Answer by yoyo · Nov 16, 2011 at 06:54 PM

This may not provide the user experience you want, but worth mentioning that the Application.OpenURL method will open a browser to the provided URL, which you could use to display PDF files from the web (http:// URL) or local storage (file:// URL).

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by Paulius-Liekis · Aug 21, 2013 at 08:30 PM

This seems to do a good job: http://www.francescogallorini.com/2011/02/unity-sharp-pdf/. It doesn't require extra libraries.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Narines · May 26, 2017 at 01:16 AM 0
Share

This seems to create PDF, not render them.

avatar image PauliusFatmap · May 26, 2017 at 06:46 AM 0
Share

OH, you're right. The answer doesn't answer the question.

avatar image
0

Answer by MadhurSalvi · Sep 17, 2019 at 05:49 AM

I know I am posting offtopic question here , since i was unable to find any post regarding the sharp pdf with unity3d I am using the sharp pdf package with unity3d and i am facing difficulties for windows platform like: 1. How to dynamically increase the column height according to the text size at runtime. 2. How do i insert an image without using the co-routine function. 3. How to dynamically write the data on the new page if current page is filled and data is still pending. For example, there are 50 rows in my table at runtime and one first page 30rows occupy the space, then how do i dynamically write the remaining 20 rows on second page. 4. Instead of storing the file in root folder, in assets folder , how can i store the pdf at different location by selecting the folder from the system.

Can anyone please help me out, it would be great help....Thank you in advance.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Writing Files and Reading them in iTunes (or other pc app) 1 Answer

How to make unity contents with pdf? 0 Answers

DirectoryInfo().GetFiles works incorrectly in Standalone 2 Answers

How to hide Unity files 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges