>> Dropbox you can use without sending an email address for download.
Here's the DropBox url. https://www.dropbox.com/sh/8a35afhdkax2agp/AADwJ8SOtLaeuWZlicLVZ6Waa?dl=0
>> But i think THIS is the wrong place here for you. This here is a small community with and for developers.
Well, we paid for Quick PDF through https://www.debenu.com/products/development/debenu-pdf-library/ & http://www.quickpdf.org/ . They then pointed us to this forum. Not your fault. We haven't found any other forums for QUICK PDF by the way.
>> If you can explain your problem in a detailed way and if you think that's a library error then you should post it on the official support page from Foxit/Debenu.
We did that for few different issues & still haven't heard back for a few months now. That does suck for us here unfortunately. One of us called the employer's employee there in another country & talked a little but that employee was so swapped with other stuff. So, we're kinda stuck here with not much help. Oh well
>> This is not related to QuickPDF rather to AcrobatReader - install different AcrobatReader version and it will be fine.
The customer is using the latest version of Adobe Acrobat Reader DC. Our staff use Adobe Professional to create a PDF template. I don't see how does changing the product help us, we can't simply change it cuz of 20+ years in using Adobe Professional to make those PDF templates & it is too much work to start over from scratch with different products.
I will take a look at NormalizePage(). We only use the Helvetica, Courier New font that is available as TTF on the server's local disk where Amazon software reside on.
Will take a look at your other link.
Any other solutions you have on solving the Chrome PDF & Adobe PDF difference will be great!
Our script is below. I had to copy & paste them from several files into 1 short version script.
--snip--
public class FormPDFService : IFormPDFService { private readonly IPdfEditorService _pdfEditorService;
public FormPDFService( IPdfEditorService pdfEditorService, IAmazonManagerService amazonManagerService, IFormService formService ) { _pdfEditorService = pdfEditorService; _amazonManagerService = amazonManagerService; _formService = formService; }
public byte[] GetMappedFormToPrint(FormWriter formWriter, bool isDocuSign) { var pdfBytes = new byte[] { }; var pdfApp = _pdfEditorService.PdfInitialize(); var pdfFilename = formDescription.ToLower().EndsWith(".pdf") ? $"{formDescription}" : $"{formDescription}.pdf"; var azureKeyName = $"{formWriter.Company.DealPackAcctNo}/Foo PDF/{pdfFilename}";
formWriter.PdfTemplateLocation = pdfFilename;
using (var pdfFileStream = _amazonManagerService.GetPdfTemplate(azureKeyName)) using (var ms = new MemoryStream()) { pdfFileStream.CopyTo(ms); pdfBytes = ms.ToArray(); }
if (pdfApp.LoadFromString(pdfBytes, null) == 0) { var error1 = pdfApp.LastRenderError(); // https://www.debenu.com/docs/pdf_library_reference/LastErrorCode.php var error2 = pdfApp.LastErrorCode(); Console.Out.WriteLine($"Unable to load PDF from data stream,\nError #1: {error1},\nError #2: {error2}"); throw new Exception("Unable to load PDF from data stream"); }
var swTimeout = (30 * 1000); // 1 second = (1 second * 1,000 milliseconds); var swIsTimedOut = false; var swLoop = new Stopwatch(); swLoop.Start();
for (int fieldIX = 0; fieldIX < pdfApp.FormFieldCount(); fieldIX++) { if (swLoop.ElapsedMilliseconds >= swTimeout) { swLoop.Stop(); swIsTimedOut = true; break; }
var loopCounter = fieldIX + 1; var fieldName = pdfApp.GetFormFieldTitle(loopCounter); // FoxIt QuickPDF start with 1, not 0.
if (string.IsNullOrEmpty(fieldName)) { continue; } else if (fieldName.EndsWith(".")) // This indicate we have AcroForm field-name duplications. (FoxIt Quick PDF append the "." to it for unknown reasons). { fieldName = fieldName.Substring(0, (fieldName.Length - 1)); }
var fieldResult = _formService.SendDpValuesToPdf(fieldName, formWriter); if (fieldResult.Value != null) { var fieldValue = fieldResult.Value.ToSafeString().Trim();
if (!isDocuSign && fieldValue.StartsWith(@"\")) { continue; // Ignore DocuSign values. } else if (string.IsNullOrEmpty(fieldValue)) { // Notice: We can't assign any blank value here, or it will wipe out the PDF's default value that our employer's Support staff programmed it with in Adobe Professional. continue; }
if (pdfApp.SetFormFieldValueByTitle(fieldName, fieldValue) == 0) { var error1 = pdfApp.LastRenderError(); // https://www.debenu.com/docs/pdf_library_reference/LastErrorCode.php var error2 = pdfApp.LastErrorCode(); Console.Out.WriteLine($"Internal issue(s) found when setting Form Field's value,\nError #1: {error1},\nError #2: {error2}"); } } }
swLoop.Stop();
pdfApp.SelectedDocument();
pdfBytes = pdfApp.SaveToString();
return pdfBytes; } } --snip--
|