Open File Dialog + printing specific page of PDF

customization

(Aaron Moreng) #1

Not sure if anyone here has done something similar, but I’m looking into implementing an open file dialog allowing user to choose a PDF. These PDFs are comprised of multiple pages. I’d like the user to be able to choose a page of that PDF and have the program copy that page to a new file and place it somewhere.
I’ve looked into parsing the PDF data and printing that page, but it looks like this is pretty reliant on third party libraries like PDFSharp or iTextSharp, which I’m trying to avoid.
Anybody do something similar within Epicor?


(Jose C Gomez) #2

I’ve done it with PDFSharp and iTextSharp but you do need those libraries. Nothing native in Epicor or .NET for PDF Processing. It does work well though


(Aaron Moreng) #3

Thanks, I’ll look into doing it that way. Too bad there isn’t native .NET support for this!!


(Aaron Moreng) #4

Using iTextSharp, I can read the document text to string, but it’s all encoded looking text, did you get similar results?
I’m sure it’s PDF dependent, but still…


(Mark Wonsil) #5

In ITextSharp, you need to use the PDF object model they created to copy a page.

Another option is just to open it with your regular PDF reader, and choose Print (Current Page) and have the printer be the PDF printer and it will prompt for a location to save that page. A little more education for the user but it works it other situations like when you cannot save a PDF.

Mark W.