Created
April 12, 2017 15:47
-
-
Save xola139/da6538caab0f58752b57322ae8b4a033 to your computer and use it in GitHub Desktop.
Agregar pdf en html apartir de un flujo de datos base63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //se crea el objeto para poder embeberlo dentro del html 'arrayFile' es el flujo de datos | |
| var objbuilder = ''; | |
| objbuilder += ('<object width="100%" height="100%" data="data:application/pdf;base64,'); | |
| objbuilder += (arrayFile); | |
| objbuilder += ('" type="application/pdf" class="internal">'); | |
| objbuilder += ('<embed src="data:application/pdf;base64,'); | |
| objbuilder += (arrayFile); | |
| objbuilder += ('" type="application/pdf" />'); | |
| objbuilder += ('</object>'); | |
| $('#appendPDF').replaceWith(objbuilder); | |
| //Se coloca un contenedor del pdf en este caso se utilizo img | |
| <img id="appendPDF" class="img-responsive"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment