We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF Viewer: controls are not aligned

Hello,

We using html viewer to view the pdf files in browser and we see that controls (edit controls) on pdf file are not aligned properly.

P.S. I have attached the screen shot to show the issue.

Please help with this issue.

Thanks,

Dharmesh

Hi Dharmesh,


Thanks for contacting support.

Can you please share some details regarding HTML viewer you are using to view the documents. Are you converting PDF file to HTML format and then displaying it inside HTML viewer or following some other approach. If possible, please share some sample project and resource PDF files causing display issues, so that we can try replicating the issue in our environment. We are sorry for this inconvenience.
We using the viewer that you guys have provided - one that uses canvas (editor.js) to display PDF pages in browser. The code/logic was borrowed from AsposePdfEditor sample.

P.S. Our requirement is to support filling the PDF files online.

I have attached the PDF document that was used in the screen shot.

Let me know if you need any other information.


Hi Dharmesh,


Thanks for sharing the details.

PdfViewer class offers the feature to print PDF files. Futhermore, Aspose.Pdf for .NET does not offer the feature to display PDF files and in order to display them, you need to transform the pages to Image format and display the images in your application.

However as a workaround, you may consider using AssemblyApp of our sister company named GroupDocs.
Hello Nayyer ,

May be I was not clear about the scenario. Let me try one more time,

Our requirement is to provide online PDF form filling support - for our users.

We looked as Aspose sample - AsposePdfEditor (part of .NET sample in Aspose_Pdf_NET-master sample - Showcases\HTML5_PDF_Editor_by_Aspose_Pdf_NET\AsposePdfEditor)

This sample does convert the PDF files into image and uses editor.js (HTML5 canvas) to display the converted PDF file, page by page.

This sample also allows to overlay pdf fields - with editable controls. So that end users can fill in the fields in form and save it.

We need help with resolving some issues that we see with this viewer (editor.js):
- We need to know how to resize the canvas to show the pdf page in that resized canvas
- We see the controls that overlay on the pdf file image are not aligned properly. What do we need to do to fix that issue.


P.S. If you propose that editor.js is not a right solution for us - then please guide us in right direction. Our need is simple - provide online form filling capability to the users.

Thanks,

Dharmesh


Hi Dharmesh,


Thanks for sharing the details.

The above specified approach of converting PDF pages to Image and displaying the image in canvas control is a workaround and in order to maintain the aspect ratio, you will have to re-size image dimensions according to canvas dimensions. However another approach can be to render/open PDF form inside PDF file and then export Acro form data to XML file or you can also post Acro form data to external sites. For further details, please visit

Hello Nayyer,

My requirement is simple - allow user to fill up a PDF file in browser and submit it.

I was looking at the possibility of using AcroForm to allow filling up the PDF file in browser. But kind of lost in the details.

Is there a sample that I can refer to?

Please guide us in right direction.

Thanks,

Dharmesh




Hi Dharmesh,


Thanks for sharing the details.

As per above stated requirements, you may consider loading PDF file in Document object, save the file to Response object in Web application and set document type as “application/pdf”. The user will input data inside PDF form and then data can be submitted to external URL or in XML format as specified in links shared earlier.

However as a workaround, you may consider using AssemblyApp of our sister company named GroupDocs which provides the feature to display form, fill data and gather information from forms.