Hi @Sahil333 , I used to have similar question / problem in the past, could this help you finding some direction ?
https://forum.jsreport.net/topic/878/merging-with-existing-pdf-example/2
MI53RE19
@MI53RE19
Posts made by MI53RE19
-
RE: Concatenate external pdfs into one pdf
-
RE: Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page
Indeed, I didn't realised this aspect, apologies.
Here is an updated version that will be, again, based on jan_blaha way AND tested against a lorem as you suggested before getting back to you
https://playground.jsreport.net/w/MI53RE/C3~M5Vyo -
RE: Ensure print double-sided to ensure that reports added with pdf-utils always start on a new page
Hi @dfiorentin could this solve your problem : https://playground.jsreport.net/w/MI53RE/ymmZxJ0F ?
(did use @jan_blaha solution as base) in this case we only add a blank page to documents with odd number of page without having to edit jsreport-pdf-utils directly -
RE: Google charts
@Arcus16 using DOM dataset attribut I did manage to pass data to your chart see this playground, hope this can help
-
RE: Merging with existing PDF example
Hi,
Thanks for the feedback, I'll look at it right away.Thanks again!!
-
RE: Merging with existing PDF example
Hi @jan_blaha ,
I read somewhere you were talking about releasing jsreport 2.4.0 quite soon, will this update include the patch you did mention before or do you still need to look deeper into it ?Thanks for your help!!
-
RE: Merging with existing PDF example
Hi Jan, sorry for the delay,
I'm not sure I understand clearly, is it about the last PDF I sent you? Regarding the reason as of why is
max call stack reached
?
I do not use razor nor any asp.net personnaly so that is why i'm quite confused -
RE: Merging with existing PDF example
Hi @jan_blaha , thanks for your help!!
I understand the problem of PDF spec, many sources won't implement it the same way, we have to deal with PDF coming from various clients in another product and it is true that we have some conflict while attempting to parse them.
Regarding the pdf I will send it to you by email, I did made the document shorter durong the test but still encounter the error, if you need the full version let me know
Thank you again!
-
RE: Merging with existing PDF example
Hi Jan!
I cannot reproduce with the given exemple as it happens only from the imported PDF
but you can look there as they do disapear on this one (execute sowesign.report by itself first so you can compare)https://playground.jsreport.net/w/anon/Ze4gsN1J
, also I just tried with another PDF from another source and this time charaters that were missing in the first PDF were all present here, I would assume that it might be to how the original PDF was generated (by Word if I got it right) I did however tried with 2 others PDF both generated with word : first one failed because of a max call stack reached :
2019-01-17T16:06:40.622Z - info: Starting rendering request 1 (user: null) 2019-01-17T16:06:40.625Z - info: Rendering template { name: sowesign.signature.report, recipe: chrome-pdf, engine: handlebars, preview: true } 2019-01-17T16:06:40.627Z - debug: Inline data specified. 2019-01-17T16:06:40.628Z - debug: Resources not defined for this template. 2019-01-17T16:06:40.631Z - debug: Executing script sowesign.signature.script 2019-01-17T16:06:40.801Z - debug: Base url not specified, skipping its injection. 2019-01-17T16:06:40.818Z - debug: Rendering engine handlebars 2019-01-17T16:06:41.000Z - debug: Compiled template not found in the cache, compiling 2019-01-17T16:06:41.002Z - debug: Executing recipe chrome-pdf 2019-01-17T16:06:41.249Z - debug: Converting with chrome HeadlessChrome/72.0.3617.0 using dedicated-process strategy 2019-01-17T16:06:41.516Z - debug: Chrome will wait for network iddle before printing 2019-01-17T16:06:46.237Z - debug: Running chrome with params {"printBackground":false,"marginTop":"","height":"297.3mm","width":"210mm","waitForNetworkIddle":true,"margin":{"top":""}} 2019-01-17T16:06:46.550Z - info: pdf-utils is starting pdf processing2019-01-17T16:06:46.947Z - debug: Detected 1 pdf operation(s) to process 2019-01-17T16:06:46.948Z - debug: Running pdf operation merge 2019-01-17T16:06:46.949Z - info: Starting rendering request 2 (user: null) 2019-01-17T16:06:46.951Z - info: Rendering template { name: sowesign.report, recipe: import-pdf, engine: none, preview: true } 2019-01-17T16:06:46.952Z - debug: Inline data specified. 2019-01-17T16:06:46.953Z - debug: Resources not defined for this template. 2019-01-17T16:06:46.955Z - debug: Base url not specified, skipping its injection. 2019-01-17T16:06:46.960Z - debug: Rendering engine none 2019-01-17T16:06:46.983Z - debug: Compiled template not found in the cache, compiling 2019-01-17T16:06:46.984Z - debug: Executing recipe import-pdf 2019-01-17T16:06:47.002Z - debug: Skipping storing report. 2019-01-17T16:06:47.021Z - info: Rendering request 2 finished in 72 ms2019-01-17T16:06:47.364Z - warn: Error when processing render request Maximum call stack size exceeded RangeError: Maximum call stack size exceeded at String.replace (<anonymous>) at new PDFName (D:\DEV\www\Groupe_8\jsreport\node_modules\jsreport-pdfjs\lib\object\name.js:34:17) at Function.parse (D:\DEV\www\Groupe_8\jsreport\node_modules\jsreport-pdfjs\lib\object\name.js:94:12) at Function.parse (D:\DEV\www\Groupe_8\jsreport\node_modules\jsreport-pdfjs\lib\object\dictionary.js:71:27) at Object.exports.parse (D:\DEV\www\Groupe_8\jsreport\node_modules\jsreport-pdfjs\lib\object\value.js:20:30) at Function.parse (D:\DEV\www\Groupe_8\jsreport\node_modules\jsreport-pdfjs\lib\object\object.js:68:28) at parseObject (D:\DEV\www\Groupe_8\jsreport\node_modules\jsreport-pdfjs\lib\object\reference.js:67:20) at PDFReference.get [as object] (D:\DEV\www\Groupe_8\jsreport\node_modules\jsreport-pdfjs\lib\object\reference.js:13:17) at Function.addObjectsRecursive (D:\DEV\www\Groupe_8\jsreport\node_modules\jsreport-pdfjs\lib\parser\parser.js:61:35) at D:\DEV\www\Groupe_8\jsreport\node_modules\jsreport-pdfjs\lib\parser\parser.js:78:18 2019-01-17T16:06:47.372Z - warn: Error during processing request at http://localhost:5490/api/report/sowesign.signature.report
this one was quite important and did contain lot of image so I will look deeper into that.
The second one was shorter and containing lot of special char but some did disapeared again or were replaced (é => i for example). I will try with some more PDF from different sources maybe it is more about how word is encoding the pdf first, which cause conflict during merge operation ?