Show PDF directly from byte array without saving into Hard Disk in c# - pdf-viewer

I'm trying to show a PDF directly from byte array without saving into Hard Disk n c#. Is there any component(pdf viewer) which doesn't need a "file" as input?
Thanks in advance.

Finally I used XtremeDocumentStudio.NETFree and it's working well.
documentViewer1.LoadDocument(mtStream, "");

Related

Printing in Zebra label printer

I'm trying to print images on a Zebra printer using ZPL commands.
This is the code:
^XA
^FO10,10^XGR:ICONE.GRF,3,3^FS
^XZ
My problem is that I can't print image from the Flash Memory. I only get image printed from DRAM memory. Could some one give me some tips?
Your ZPL sample relies on the printer having been pre-configured correctly by uploading the image to the printer memory (at the printer memory path R:ICONE.GRF). This is a little more brittle than just embedding the image directly in the ZPL, as you have found out.
If you're always embedding the same image (which appears to be the case), and if you're not worried about shaving milliseconds off of your print latency (most people aren't), then I'd recommend embedding the image directly in your ZPL using the ^GF command.
There's a little bit of black magic involved in getting the ^GF command right, but it's pretty easy if you have ZebraDesigner installed or if you just use Labelary to add the image to your label ZPL template.
Why don´t you create a memory bitmap loading the image from E: into it and printing from this memory image? You could do something like:
Dim image1 As Bitmap = CType(Image.FromFile("E:\ImageFile.bmp", True), Bitmap)
You may also put a PictureBox in your form, load the image into it and call your Zebra code on that control - it´s in memory too.
I just figured out my stupid error in the code:
^FO10,10^XGR:ICONE.GRF,3,3^FS
The solution was simply change de "R" by "E":
^FO10,10^XGE:ICONE.GRF,3,3^FS
Thanks for the ansswers.

malformed pdf document asks to save changes

We have this big web project where the user can print the html to pdf. We are using dompdf, and have somewhat fixed the long cell issues that cause the pdf to have several blank pages. Now the issue is that the saved pdf, when closing, always asks if the user wants to save changes. I have verified that the pdf has the proper %%EOF, and have checked for object consistency. What else could be causing this problem?
After reading this introduction to pdf I realized that if the pdf was modified, I had to accomodate all the object offsets so that they would point to the object start location.

How to change value of a textbox in a pdf

I have to make several certificates with the same design but different names. So I've tried to make an uncompressed pdf file with a place holder text and tried to change it with a text editor. For some reason it didn't work. I could only see a single letter of the replaced text.
When I try the same thing with an eps file, it works but since eps doesn't keep (AFAIK) page orientation, there is a chance that it something will be different with different names.
Does anyone know why this didn't work or how to change a text box in a pdf file (with sed)?
(I created the master pdf with Illustrator CS4)
Thank you
In general, editing PDFs in a text editor is a Bad Idea. PDFs depend on the byte offsets of various objects to not move.
If you KNOW your editor won't change the EOL bytes (or what it thinks are eol bytes), and you DO NOT change the length of the text entry's object as a whole, you're okay.
For example:
1 0 obj
<</Type/Annotation/Subtype/Widget/V(PlaceHolder Value)/T(Field Title)...>>
endobj
If your new value is longer than "placeholder value", you're screwed.
Most PDFs contain quite a bit of compressed binary data. Some of that data WILL be misinterpreted as EOL characters. Changing them will:
a: break your compressed stream
b: possibly change the byte offsets of the rest of the PDF.
When I hack on PDF files, I always use a hex editor.
Bottom Line: Don't mess with PDFs as a text stream. Mess with them as PDF files, using a PDF library. There's sure to be one capable of altering form field values in your language of choice.
You can also look into FDF and XFDF to see if they'll suit you better. Both file formats store field/value pairs and a reference to the form to use with those pairs. FDF uses PDF's syntax, while XFDF is an XML grammar. You can serve the [X]FDF to your end user and they will see the filled-in form.
WARNING: Unless the form is Reader Enabled (requires Acrobat (pro?)), they won't be able to save the version of the form they get after opening the [X]FDF, only view/print it. Of course they can save the [X]FDF, but many users might balk at this Strange New Format.

How to convert PDF file to .doc format in Objective-C?

right now i am working on one ipad application where i am giving facility of opening the pdf file and also to customize it,now i want to add one functionality like i want to convert that pdf file in .doc format.
I researched but did not get any way around. Can anybody help me out?
Thanking you in advance.
I wrote an article on PDF to text conversion issues. If you look at some of the existing PDF to Word conversion tools (ie BCL) you will see what is realistically possible with a lot of work.
It’s not possible to convert a generic PDF back into a text format. I guess you could render the PDF into images and create a DOC from those, but that doesn’t sound very useful.

Concatenating PDF

After concatenating 2 pdf's using PdfCopyFields, I am able to edit the PDF fields, but I can't save the merged PDF. Why am I not able to save the PDF after doing this?
A form that has been Reader Enabled must be saved in append mode in order to continue working as such. PdfCopyFields creates a new PDF from scratch.
To get this working, you'll have to duplicate most of PdfCopyField's code via a PdfStamper set to append. Hurray for open source.
And keep in mind that iText 5.x is AGPL. Anyone with access to the program output must also have access to the source.
(which is why quite a few people are still using 2.1.7)