English 中文(简体)
how to copy only body of pdf file using itextsharp or pdfsharp in C#
原标题:

I am still waiting for the reply from you all. I really need your support.......plz

I am developing a project called pdf recovery. In that i want to just copy the body of file into another pdf file using itextsharp C# lib.

i want to parse entire file as soon as i get body i.e. " 1 0 obj<<....>>endobj " according to pdf reference. then copy full body to another pdf file.

i dont to want to read header,xref table..etc.

I am using itextsharp lib for creating a file. if pdfsharp provides this i will move to that one. Also give some tips about both lib. Thnx. :)

最佳回答

If you use the page stamper (like in the example at http://1t3xt.info/examples/browse/?page=example&id=27 - this is for the Java version, but you should not have any problems adapting that to C#) it will only copy the page content, and will create a new "header" (I assume you mean the meta data) and xref table. Using this mechanism will copy all required resources (e.g. fonts, bitmaps, ...) automatically for you. If you would do it manually, you would have to do that too, and that gets a bit messy. Oh, and there is no need to parse anything. iTextSharp will do all the parsing for you.

问题回答

Have you tried asking on the Itext/ISharp mailing list?





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签