Merge PDF with Bullzip PDF

DavidJs
Member Posts: 9
Hi everyone!
I'm struggling with merging different PDF documents into one. I'm working with a NAV 17.
My code is almost the same as the example they use in their page, but the merge part.
While they use:
and for final merge:
but no file is created nor modified.
Am I missing something?
Is there a workaround?
Thanks in advance!
I'm struggling with merging different PDF documents into one. I'm working with a NAV 17.
My code is almost the same as the example they use in their page, but the merge part.
While they use:
// Merge with other PDF files. pdfSettings.SetValue('MergeFile', mergeBeforeFileName + '|.|' + mergeAfterFileName);I use for the path
i := 1; rFilePath.SETRANGE(Path, PathParam); rFilePath.SETRANGE("Is a file", TRUE); IF rFilePath.FINDSET THEN BEGIN REPEAT FileNames[I] := PathParam + rFilePath.Name; i += 1; END; UNTIL rFilePath.NEXT = 0;
and for final merge:
pdfSettings.SetValue('MergeFile', PDFFinalRoute + '|.|' + FileNames[i]);
but no file is created nor modified.
Am I missing something?
Is there a workaround?
Thanks in advance!
0
Best Answer
-
SOLVED
In case anyone in the future has the same problem. You HAVE to print something to merge with.
I couldn't use it as a tool to merge N existing pdfs. So I solved it by creating a white sheet report to merge in between the ones I wanted to merge.
I hope someone finds that usefull!0
Answers
-
My guess is that you are missing the most important line:
pdfSettings.WriteSettings(TRUE);
The SetValue function only describes what BullZip should do, you have to WriteSettings to actually execute the instructions.
As you're testing, you might also want to utilize the status file, just to make sure that everything goes fine.(before pdfSettings.WriteSettings(TRUE);) pdfSettings.SetValue('StatusFile', statusFileName); [..] [..] IF pdfUtil.WaitForFile(statusFileName, 20000) THEN BEGIN // Check status file for errors. IF pdfUtil.ReadIniString(statusFileName, 'Status', 'Errors', '') <> '0' THEN BEGIN ERROR('Error creating PDF. ' + pdfUtil.ReadIniString(statusFileName, 'Status', 'MessageText', '')); END; END ELSE BEGIN // The timeout elapsed. Something is wrong. ERROR('Error creating ' + pdfFileName) END;
0 -
I did indeed had the pdf.WriteSettings(true);
Added this as you mention,As you're testing, you might also want to utilize the status file, just to make sure that everything goes fine.(before pdfSettings.WriteSettings(TRUE);) pdfSettings.SetValue('StatusFile', statusFileName); [..] [..] IF pdfUtil.WaitForFile(statusFileName, 20000) THEN BEGIN // Check status file for errors. IF pdfUtil.ReadIniString(statusFileName, 'Status', 'Errors', '') <> '0' THEN BEGIN ERROR('Error creating PDF. ' + pdfUtil.ReadIniString(statusFileName, 'Status', 'MessageText', '')); END; END ELSE BEGIN // The timeout elapsed. Something is wrong. ERROR('Error creating ' + pdfFileName) END;
I've been checking for the "ini" file to be created on the path file but it does not create, if this add any insight.
0 -
SOLVED
In case anyone in the future has the same problem. You HAVE to print something to merge with.
I couldn't use it as a tool to merge N existing pdfs. So I solved it by creating a white sheet report to merge in between the ones I wanted to merge.
I hope someone finds that usefull!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions