DOCX Portrait Images are not aligned with table cell - c#

I am new to Docx, and it is really very handy, Thanks DOCX for this development. I have tried using DOCX with photos captured through mobile phone. The photos are portrait and some are landscape.
I do have a word template that I am loading when i run my app. while inserting photos into a tables, the photos does not look correctly placed ("Over Lapped").
Example of the results
Please have a look on the code in this repo you may test it to see the results. I have also uploaded the used images to the repo. any thoughts?
https://github.com/mostafa901/Testing-Nova

Finally, after digging a lot, I said I should post my findings may be it come to be useful to someone. I discovered it is not a mistake in the code, but the template file used is of an old office version.
Thanks.

Related

Best way to display pdf document in asp.net application

I'm looking for the best way to display pdf document on a website. Surely I need to convert it to jpeg or gif for the browser to handle it. I read few posts but most refer to GhostScript and its pdf2image. But that solution calls for starting a process that would save a copy of pdf doc to the file system and then would have to be loaded back into memory for displaying. Frankly I find it a bit clumsy. For those of you who have done it, what library you used and if you could attach a link to some examples, I'd greatly appreciate it.
I'm developick a web application that helps manage manufacturing process and is accessed fron android tablets. Company has a stockpile of documentation in pdf files that is to be delivered to production managers. I'd love the solution to be akin Crystal Report Viewer contron but I I understand that I have to stick to pdf to image conversion. Please give me some advise here.
My advice is don't over think this.
You can simply add a link to the PDF file, which will open on a new tab.
You can take a look at http://mozilla.github.io/pdf.js/ which will allow you to render a PDF on the client side.
Or if you decide to go with a Ghostscript, you can take a look at http://ghostscriptnet.codeplex.com
By all accounts the PDF Focus .NET library seems to be the best solution. A wrd of advice is to add a cleanup method to the page unload to delete all temporary files that were used to feed source into image controls when displaying pictures on a website.

Outputting Data View Tables in PDFsharp

I have a problem I'm not sure can be solved, I wondered if I could ask for help on here.
I am creating an invoice in PDFsharp in C#, I have written the first page displaying strings taken from datagrids along the way. That's all fine.
However I'm coming to the summary page and I need to output the values looping through the datagridview into the PDF. Is that possible within PDFsharp or do I have to go to MigraDoc to do this?
If so, is MigraDoc still supported?
As I cannot get the references into my solution.
Any help would be appreciated.
Thanks.
MigraDoc is still supported.
MigraDoc uses PDFsharp to create PDF files, so everything that can be done with MigraDoc can also be done with PDFsharp only.
MigraDoc supports tables with borders and handles pagebreaks automatically - so for invoices it is most likely a good idea to use MigraDoc and not PDFsharp.
See also:
http://www.pdfsharp.net/wiki/Invoice-sample.ashx
With respect to adding the references, detailed error messages would be helpful.
The source code package of MigraDoc includes samples with Visual Studio solutions and all references.

How to convert rtf or docx to PDF server-side (without having OpenType fonts rasterized or substituted)

does anyone know of a tool that permits rtf/doc/docx conversion to pdf from C# ?
These documents contain all sorts of fonts (TrueType or OpenType), and I am looking for a tool that will not rasterize the OpenTypes ones and render them rather accurately.
Many thanks in advance for any pointers !
have a look at Aspose.Words
It works server side and does not require Office Automation.
I've used it in a commercial project and it works really good. But it's a commercial component, so you need to pay for a license (which is not that cheap)
EDIT
please have a look at this thread in the Aspose forum
I've used iTextSharp myself in a C# project recently, and it worked pretty well.
Unfortunately, I'm not able to give you any example, as that would make a huge post (and the code is pretty confidential) :)
But here's the link to their site, if that helps:
http://itextpdf.com/
Hope this fits your needs!

Wanted: ASP.NET control to view/print PDF, TIFF, possibly more?

I'm looking for an asp.NET control that will allow for viewing and printing of a pdf and TIFF within a web form. I'm willing to use more than 1 control if needed (1 control for pdf, 1 for Tiff, show and hide based on file extension), but I have not been able to find a good Tiff viewer.
Files are stored on our LAN in a shared folder, and this application is an intranet site.
Open source / free licensing preferred, but I'm willing to look at paid options as well.
http://www.alternatiff.com/ is one of the viewers that I've seen used for this type of viewing of tiffs.
You can get a free licence of ABCPDF (provided you link back to their site) which will do the conversion from TIFF to PDF for you as per #Chris Lively 's suggestion.
It'll also do conversion from PDF to TIFF if you decide to do things backwards.
It makes sense to present the content in a common format. If you wanted to you can embed the PDF in the browser to create the 'seamless' experience you're looking for using something like PDFObject.
As #BenCr says though, PDF is a really common format and the tools already exist to open and work with them, so introducing new ways to perform existing tasks could actually end up complicating matters unnecessarily.
I'm in total agreement with #BenCr on this.
Viewing PDFs is an extremely common thing to do. This isn't a "technical" issue by any stretch.
It sounds like you have some type of faxing solution in place that is creating these documents. Most likely multi-page TIFF and PDFs.
If this is the case you might want to just convert the TIFFs to PDFs to begin with and run everything through Adobe's pdf reader. Every online fax solution does this.
You could try http://issuu.com/ and they appear to have a API too if you want to go that deep.
We used the the Seadragon control to do this. I think it was an overkill and we should have just rolled our own -- would have been cheaper than integrating it. TIFFs and PDFs are converted to PNG on the server side. I don't think you can do better than that, especially with PDFs (assuming you don't want to use Acrobat Reader to display them). Convert PDFs to PNG using Xpdf/Poppler.
How about using Google Docs Viewer?
EDIT: Probably not working, since the viewer has to read the document from your URL; when it's on the Intranet, this won't work.
If you can mess about with mime types -- mainly by making the .tiff files expose an application/pdf mimetype -- you should be able to get acrobat to open TIFF files directly by effectively fooling the browser to open TIFF files with acrobat. Then all you need is a trusty old iframe to get you familiar UI with print buttons.

Need the .NET PDF library to edit pdf info

I need the 100% .NET library to edit PDF Info like Author, Title, Creator, Subject and Keywords. All PDF libraries I tried are unable to do this without completely resaving the hole PDF documents. So for huge files (>35MB) it takes too much time. I need only to update several text fields (see above) and I don't need to resave the entire document for this.
Is there any lib that can do it like image libraries change IPTC/EXIF fields (without changing the original image)?
Thanks for any help,
Murat
iTextSharp (hosted here) ?

Categories

Resources